Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 1,568 Lines • ▼ Show 20 Lines | bool CChainState::ConnectBlock(const CBlock &block, BlockValidationState &state, | ||||
LogPrint(BCLog::BENCH, " - Sanity checks: %.2fms [%.2fs (%.2fms/blk)]\n", | LogPrint(BCLog::BENCH, " - Sanity checks: %.2fms [%.2fs (%.2fms/blk)]\n", | ||||
MILLI * (nTime1 - nTimeStart), nTimeCheck * MICRO, | MILLI * (nTime1 - nTimeStart), nTimeCheck * MICRO, | ||||
nTimeCheck * MILLI / nBlocksTotal); | nTimeCheck * MILLI / nBlocksTotal); | ||||
// Do not allow blocks that contain transactions which 'overwrite' older | // Do not allow blocks that contain transactions which 'overwrite' older | ||||
// transactions, unless those are already completely spent. If such | // transactions, unless those are already completely spent. If such | ||||
// overwrites are allowed, coinbases and transactions depending upon those | // overwrites are allowed, coinbases and transactions depending upon those | ||||
// can be duplicated to remove the ability to spend the first instance -- | // can be duplicated to remove the ability to spend the first instance -- | ||||
// even after being sent to another address. See BIP30 and | // even after being sent to another address. | ||||
// http://r6.ca/blog/20120206T005236Z.html for more information. This logic | // See BIP30, CVE-2012-1909, and http://r6.ca/blog/20120206T005236Z.html | ||||
// is not necessary for memory pool transactions, as AcceptToMemoryPool | // for more information. This logic is not necessary for memory pool | ||||
// already refuses previously-known transaction ids entirely. This rule was | // transactions, as AcceptToMemoryPool already refuses previously-known | ||||
// originally applied to all blocks with a timestamp after March 15, 2012, | // transaction ids entirely. This rule was originally applied to all blocks | ||||
// 0:00 UTC. Now that the whole chain is irreversibly beyond that time it is | // with a timestamp after March 15, 2012, 0:00 UTC. Now that the whole | ||||
// applied to all blocks except the two in the chain that violate it. This | // chain is irreversibly beyond that time it is applied to all blocks | ||||
// prevents exploiting the issue against nodes during their initial block | // except the two in the chain that violate it. This prevents exploiting | ||||
// download. | // the issue against nodes during their initial block download. | ||||
bool fEnforceBIP30 = !((pindex->nHeight == 91842 && | bool fEnforceBIP30 = !((pindex->nHeight == 91842 && | ||||
pindex->GetBlockHash() == | pindex->GetBlockHash() == | ||||
uint256S("0x00000000000a4d0a398161ffc163c503763" | uint256S("0x00000000000a4d0a398161ffc163c503763" | ||||
"b1f4360639393e0e4c8e300e0caec")) || | "b1f4360639393e0e4c8e300e0caec")) || | ||||
(pindex->nHeight == 91880 && | (pindex->nHeight == 91880 && | ||||
pindex->GetBlockHash() == | pindex->GetBlockHash() == | ||||
uint256S("0x00000000000743f190a18c5577a3c2d2a1f" | uint256S("0x00000000000743f190a18c5577a3c2d2a1f" | ||||
"610ae9601ac046a38084ccb7cd721"))); | "610ae9601ac046a38084ccb7cd721"))); | ||||
▲ Show 20 Lines • Show All 4,165 Lines • Show Last 20 Lines |