We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c972bf2 commit 4f5de12Copy full SHA for 4f5de12
fuzz/src/chanmon_consistency.rs
@@ -207,7 +207,11 @@ impl ChainState {
207
}
208
209
fn is_outpoint_spent(&self, outpoint: &bitcoin::OutPoint) -> bool {
210
- self.blocks.iter().any(|(_, txs)| {
+ // 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)| {
215
txs.iter().any(|tx| {
216
tx.input.iter().any(|input| input.previous_output == *outpoint)
217
})
0 commit comments