mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
Merge bitcoin/bitcoin#31624: doc: warn that CheckBlock() underestimates sigops
a04f17a188doc: warn that CheckBlock() underestimates sigops (Sjors Provoost) Pull request description: Counting sigops in the witness requires context that `CheckBlock()` does not have, so it only counts sigops for non-segwit transactions. It's useful to document, but it should not be a problem. The commit message contains some historical context. ACKs for top commit: ismaelsadeeq: ACKa04f17a188ryanofsky: Code review ACKa04f17a188Tree-SHA512: 26528367a7f3cfa8540ef0b90f7aa912c8f0bc057428f20a1fd1d4e232dac77747bc20044f0fcb0ffab8a2e1fb3dbe3dab46be749553a917744ddc7a829025cb
This commit is contained in:
@@ -4062,6 +4062,8 @@ bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensu
|
||||
strprintf("Transaction check failed (tx hash %s) %s", tx->GetHash().ToString(), tx_state.GetDebugMessage()));
|
||||
}
|
||||
}
|
||||
// This underestimates the number of sigops, because unlike ConnectBlock it
|
||||
// does not count witness and p2sh sigops.
|
||||
unsigned int nSigOps = 0;
|
||||
for (const auto& tx : block.vtx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user