|
|
@ -1710,6 +1710,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd |
|
|
|
// before the first had been spent. Since those coinbases are sufficiently buried its no longer possible to create further
|
|
|
|
// before the first had been spent. Since those coinbases are sufficiently buried its no longer possible to create further
|
|
|
|
// duplicate transactions descending from the known pairs either.
|
|
|
|
// duplicate transactions descending from the known pairs either.
|
|
|
|
// If we're on the known chain at height greater than where BIP34 activated, we can save the db accesses needed for the BIP30 check.
|
|
|
|
// If we're on the known chain at height greater than where BIP34 activated, we can save the db accesses needed for the BIP30 check.
|
|
|
|
|
|
|
|
assert(pindex->pprev); |
|
|
|
CBlockIndex *pindexBIP34height = pindex->pprev->GetAncestor(chainparams.GetConsensus().BIP34Height); |
|
|
|
CBlockIndex *pindexBIP34height = pindex->pprev->GetAncestor(chainparams.GetConsensus().BIP34Height); |
|
|
|
//Only continue to enforce if we're below BIP34 activation height or the block hash at that height doesn't correspond.
|
|
|
|
//Only continue to enforce if we're below BIP34 activation height or the block hash at that height doesn't correspond.
|
|
|
|
fEnforceBIP30 = fEnforceBIP30 && (!pindexBIP34height || !(pindexBIP34height->GetBlockHash() == chainparams.GetConsensus().BIP34Hash)); |
|
|
|
fEnforceBIP30 = fEnforceBIP30 && (!pindexBIP34height || !(pindexBIP34height->GetBlockHash() == chainparams.GetConsensus().BIP34Hash)); |
|
|
@ -1849,6 +1850,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd |
|
|
|
if (!pblocktree->WriteTxIndex(vPos)) |
|
|
|
if (!pblocktree->WriteTxIndex(vPos)) |
|
|
|
return AbortNode(state, "Failed to write transaction index"); |
|
|
|
return AbortNode(state, "Failed to write transaction index"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert(pindex->phashBlock); |
|
|
|
// add this block to the view's block chain
|
|
|
|
// add this block to the view's block chain
|
|
|
|
view.SetBestBlock(pindex->GetBlockHash()); |
|
|
|
view.SetBestBlock(pindex->GetBlockHash()); |
|
|
|
|
|
|
|
|
|
|
|