Review report

bitcoin/bitcoin: PR #36734

1 suggestion

Optional improvements

Link

[suggestion] · Consensus-invalid scripts remain eligible for the extrapool

The filter excludes TX_CONSENSUS results, not all consensus-invalid transactions, so the PR description overstates its scope.

Location: src/node/txdownloadman_impl.cpp:359 (head).

Details and suggested fix

A transaction that reaches policy script checks and fails because of a bad signature, whether legacy or with its witness present, receives TX_NOT_STANDARD. CheckInputScripts chooses that result from the supplied standard flags, not from the particular rule that failed. PolicyScriptChecks then returns before ConsensusScriptChecks can distinguish consensus failures. Missing-witness failures have a separate TX_WITNESS_STRIPPED override. Consequently, on a first rejection, an ordinary bad-signature transaction still enters the enabled extrapool when its dynamic memory usage is below 100000 bytes. Narrow the PR description to transactions rejected as TX_CONSENSUS and explicitly note that consensus-invalid scripts can still be stored. Do not exclude all TX_NOT_STANDARD results: that would also discard consensus-valid transactions useful for reconstruction. Distinguishing the script failures would require additional verification under consensus flags, so retain the current inexpensive filter unless that extra work has a stated justification.


Coverage details