Review report

core: PR #36002

1 minor finding

Earlier concerns neither republished nor resolved: 2 minor findings. See the Run archive for their assessments.

Findings

Link

[minor] · A readable stale copy masks the pruned active-chain block

If the active-chain block containing a transaction is pruned while a stale block containing the same transaction remains readable, lookups return the stale block hash, understating confirmations and potentially producing a proof that will not verify.

Location: src/index/txindex.cpp:223 (head).

Details and suggested fix

In FindTx, a pruned active-chain candidate is recorded and skipped, but a readable stale candidate for the same txid can still be returned. The lookup then reports the stale block hash and discards the pruned hash. As a result, getrawtransaction <txid> 1 reports confirmations: 0 for a confirmed transaction; if the transaction has no unspent outputs, gettxoutproof can produce a proof that verifytxoutproof rejects with “Block not found in chain.” The caller also cannot use the active block hash in a getblockfrompeer-and-retry flow. This behavior requires a reorg where both branches contain the transaction and the stale block data outlives the active block data. No production instance was identified, so real-world frequency is unconfirmed. Return TxMiss with the recorded pruned hashes once an active-chain candidate is found to be pruned, rather than falling back to a stale candidate. A pruned index entry can be a 40-bit hash-prefix false positive; in that case, retrying after fetching the block costs one extra fetch before lookup reaches the stale copy.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.