Skip to content

Commit

Permalink
doc: warn that CheckBlock() underestimates sigops
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sjors committed Jan 9, 2025
1 parent 66aa6a4 commit 0ac19a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,7 @@ 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 the witness:
unsigned int nSigOps = 0;
for (const auto& tx : block.vtx)
{
Expand Down

0 comments on commit 0ac19a9

Please sign in to comment.