]> Untitled Git - bdk/commitdiff
feat(wallet): cache txs when constructing full-scan/sync requests
author志宇 <hello@evanlinjin.me>
Wed, 1 May 2024 08:27:36 +0000 (16:27 +0800)
committer志宇 <hello@evanlinjin.me>
Fri, 10 May 2024 06:11:20 +0000 (14:11 +0800)
crates/bdk/src/wallet/mod.rs

index 4074c43101f9bb36d1d897921fb2242d3ae6a7a1..146d4677e0a77a2b299aaae68b19ac83c4902006 100644 (file)
@@ -2565,6 +2565,7 @@ impl Wallet {
     /// start a blockchain sync with a spk based blockchain client.
     pub fn start_sync_with_revealed_spks(&self) -> SyncRequest {
         SyncRequest::from_chain_tip(self.chain.tip())
+            .cache_graph_txs(self.tx_graph())
             .populate_with_revealed_spks(&self.indexed_graph.index, ..)
     }
 
@@ -2578,6 +2579,7 @@ impl Wallet {
     /// in which the list of used scripts is not known.
     pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind> {
         FullScanRequest::from_keychain_txout_index(self.chain.tip(), &self.indexed_graph.index)
+            .cache_graph_txs(self.tx_graph())
     }
 }