doc: warn that CheckBlock() underestimates sigops

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.
This commit is contained in:
Sjors Provoost 2025-01-09 12:05:58 +01:00
parent 66aa6a47bd
commit 0ac19a98f3
No known key found for this signature in database
GPG key ID: 57FF9BDBCC301009

View file

@ -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)
{