Skip to content

Commit f1d78a3

Browse files
committed
Merge bitcoin/bitcoin#31624: doc: warn that CheckBlock() underestimates sigops
a04f17a doc: 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: ACK a04f17a ryanofsky: Code review ACK a04f17a Tree-SHA512: 26528367a7f3cfa8540ef0b90f7aa912c8f0bc057428f20a1fd1d4e232dac77747bc20044f0fcb0ffab8a2e1fb3dbe3dab46be749553a917744ddc7a829025cb
2 parents 33dfbbd + a04f17a commit f1d78a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/validation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4062,6 +4062,8 @@ bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensu
40624062
strprintf("Transaction check failed (tx hash %s) %s", tx->GetHash().ToString(), tx_state.GetDebugMessage()));
40634063
}
40644064
}
4065+
// This underestimates the number of sigops, because unlike ConnectBlock it
4066+
// does not count witness and p2sh sigops.
40654067
unsigned int nSigOps = 0;
40664068
for (const auto& tx : block.vtx)
40674069
{

0 commit comments

Comments
 (0)