Skip to content

Commit 6d36fbc

Browse files
jkczyzclaude
andcommitted
f - Scan full history in is_outpoint_spent
PR #4565 moved chanmon_consistency_target to the real-hashes runner, so txids no longer collide across unrelated outpoints. The 6-block window added to dodge those collisions is no longer needed; scanning the full block history is correct and matches the behavior before the fake-hashes workaround. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8ecdab3 commit 6d36fbc

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

fuzz/src/chanmon_consistency.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ impl ChainState {
207207
}
208208

209209
fn is_outpoint_spent(&self, outpoint: &bitcoin::OutPoint) -> bool {
210-
// Only check the last 6 blocks (1 confirmation block + 5 post-confirmation) to avoid
211-
// false positives from hash collisions in older blocks. Under fuzz hashing, txids have
212-
// only 8 effective bits, so unrelated outpoints in old blocks frequently collide.
213-
let start = self.blocks.len().saturating_sub(6);
214-
self.blocks[start..].iter().any(|(_, txs)| {
210+
self.blocks.iter().any(|(_, txs)| {
215211
txs.iter().any(|tx| {
216212
tx.input.iter().any(|input| input.previous_output == *outpoint)
217213
})

0 commit comments

Comments
 (0)