|
|
|
@ -1429,7 +1429,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
@@ -1429,7 +1429,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
|
|
|
|
|
// Helps prevent CPU exhaustion attacks.
|
|
|
|
|
|
|
|
|
|
// Skip script verification when connecting blocks under the
|
|
|
|
|
// assumedvalid block. Assuming the assumedvalid block is valid this
|
|
|
|
|
// assumevalid block. Assuming the assumevalid block is valid this
|
|
|
|
|
// is safe because block merkle hashes are still computed and checked,
|
|
|
|
|
// Of course, if an assumed valid block is invalid due to false scriptSigs
|
|
|
|
|
// this optimization would allow an invalid chain to be accepted.
|
|
|
|
@ -1771,7 +1771,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
@@ -1771,7 +1771,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|
|
|
|
pindexBestHeader->GetAncestor(pindex->nHeight) == pindex && |
|
|
|
|
pindexBestHeader->nChainWork >= UintToArith256(chainparams.GetConsensus().nMinimumChainWork)) { |
|
|
|
|
// This block is a member of the assumed verified chain and an ancestor of the best header.
|
|
|
|
|
// The equivalent time check discourages hashpower from extorting the network via DOS attack
|
|
|
|
|
// The equivalent time check discourages hash power from extorting the network via DOS attack
|
|
|
|
|
// into accepting an invalid block through telling users they must manually set assumevalid.
|
|
|
|
|
// Requiring a software change or burying the invalid block, regardless of the setting, makes
|
|
|
|
|
// it hard to hide the implication of the demand. This also avoids having release candidates
|
|
|
|
@ -2486,12 +2486,12 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
@@ -2486,12 +2486,12 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
|
|
|
|
bool fInitialDownload; |
|
|
|
|
{ |
|
|
|
|
LOCK(cs_main); |
|
|
|
|
{ // TODO: Tempoarily ensure that mempool removals are notified before
|
|
|
|
|
{ // TODO: Temporarily ensure that mempool removals are notified before
|
|
|
|
|
// connected transactions. This shouldn't matter, but the abandoned
|
|
|
|
|
// state of transactions in our wallet is currently cleared when we
|
|
|
|
|
// receive another notification and there is a race condition where
|
|
|
|
|
// notification of a connected conflict might cause an outside process
|
|
|
|
|
// to abandon a transaction and then have it inadvertantly cleared by
|
|
|
|
|
// to abandon a transaction and then have it inadvertently cleared by
|
|
|
|
|
// the notification that the conflicted transaction was evicted.
|
|
|
|
|
MemPoolConflictRemovalTracker mrt(mempool); |
|
|
|
|
CBlockIndex *pindexOldTip = chainActive.Tip(); |
|
|
|
@ -2520,7 +2520,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
@@ -2520,7 +2520,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
|
|
|
|
|
|
|
|
|
} // MemPoolConflictRemovalTracker destroyed and conflict evictions are notified
|
|
|
|
|
|
|
|
|
|
// Transactions in the connnected block are notified
|
|
|
|
|
// Transactions in the connected block are notified
|
|
|
|
|
for (const auto& pair : connectTrace.blocksConnected) { |
|
|
|
|
assert(pair.second); |
|
|
|
|
const CBlock& block = *(pair.second); |
|
|
|
|