|
|
|
@ -1788,7 +1788,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
@@ -1788,7 +1788,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
|
|
|
|
|
|
|
|
|
|
// BIP16 didn't become active until Apr 1 2012
|
|
|
|
|
int64_t nBIP16SwitchTime = 1333238400; |
|
|
|
|
bool fStrictPayToScriptHash = (pindex->nTime >= nBIP16SwitchTime); |
|
|
|
|
bool fStrictPayToScriptHash = (pindex->GetBlockTime() >= nBIP16SwitchTime); |
|
|
|
|
|
|
|
|
|
unsigned int flags = SCRIPT_VERIFY_NOCACHE | |
|
|
|
|
(fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE); |
|
|
|
@ -2437,7 +2437,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex
@@ -2437,7 +2437,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex
|
|
|
|
|
if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) |
|
|
|
|
{ |
|
|
|
|
// Extra checks to prevent "fill up memory by spamming with bogus blocks"
|
|
|
|
|
int64_t deltaTime = block.GetBlockTime() - pcheckpoint->nTime; |
|
|
|
|
int64_t deltaTime = block.GetBlockTime() - pcheckpoint->GetBlockTime(); |
|
|
|
|
if (deltaTime < 0) |
|
|
|
|
{ |
|
|
|
|
return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), |
|
|
|
@ -2548,7 +2548,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
@@ -2548,7 +2548,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
|
|
|
|
|
CDiskBlockPos blockPos; |
|
|
|
|
if (dbp != NULL) |
|
|
|
|
blockPos = *dbp; |
|
|
|
|
if (!FindBlockPos(state, blockPos, nBlockSize+8, nHeight, block.nTime, dbp != NULL)) |
|
|
|
|
if (!FindBlockPos(state, blockPos, nBlockSize+8, nHeight, block.GetBlockTime(), dbp != NULL)) |
|
|
|
|
return error("AcceptBlock() : FindBlockPos failed"); |
|
|
|
|
if (dbp == NULL) |
|
|
|
|
if (!WriteBlockToDisk(block, blockPos)) |
|
|
|
@ -3146,7 +3146,7 @@ bool InitBlockIndex() {
@@ -3146,7 +3146,7 @@ bool InitBlockIndex() {
|
|
|
|
|
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION); |
|
|
|
|
CDiskBlockPos blockPos; |
|
|
|
|
CValidationState state; |
|
|
|
|
if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime)) |
|
|
|
|
if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.GetBlockTime())) |
|
|
|
|
return error("LoadBlockIndex() : FindBlockPos failed"); |
|
|
|
|
if (!WriteBlockToDisk(block, blockPos)) |
|
|
|
|
return error("LoadBlockIndex() : writing genesis block to disk failed"); |
|
|
|
|