We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.take
1 parent f8b4f91 commit 91b940aCopy full SHA for 91b940a
crates/wallet/src/wallet/mod.rs
@@ -1844,6 +1844,9 @@ impl Wallet {
1844
.graph()
1845
.list_canonical_txs(&self.chain, chain_tip)
1846
.filter(|canon_tx| prev_txids.contains(&canon_tx.tx_node.txid))
1847
+ // This is for a small performance gain. Although `.filter` filters out excess txs, it
1848
+ // will still consume the internal `CanonicalIter` entirely. Having a `.take` here
1849
+ // allows us to stop further unnecessary canonicalization.
1850
.take(prev_txids.len())
1851
.map(|canon_tx| {
1852
let txid = canon_tx.tx_node.txid;
0 commit comments