diff --git a/src/tracker.rs b/src/tracker.rs index a6c50524d..0f0959261 100644 --- a/src/tracker.rs +++ b/src/tracker.rs @@ -105,7 +105,7 @@ impl Tracker { ) -> Result> { // Note: there are two blocks with coinbase transactions having same txid (see BIP-30) let blockhashes = self.index.filter_by_txid(txid); - let result = daemon + Ok(daemon .for_blocks(blockhashes, |blockhash, block| { let mut visitor = FindTransaction::new(txid); match bsl::Block::visit(&block, &mut visitor) { @@ -114,9 +114,8 @@ impl Tracker { } visitor.tx_found().map(|tx| (blockhash, tx)) })? - .first() - .cloned() - .flatten(); - Ok(result) + .into_iter() + .filter_map(|e| e) // skip non-matching blocks, in case of a false-positive index hit + .next()) // return first match } }