mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03:00
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. This should not be a problem. There are 2 call sites: 1. ConnectBlock(): this checks all sigops 2. TestBlockValidity() used by getblocktemplate: this also calls ConnectBlock() 3. AcceptBlock(): this performs limited checks before storing a block on disk 4. ProcessNewBlock(): calls AcceptBlock() 4. VerifyDB(): disconnects the block at level 3, which results in ConnectBlock()
This commit is contained in:
parent
4facb94a48
commit
8a2509e21a
1 changed files with 1 additions and 0 deletions
|
@ -4047,6 +4047,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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue