From 2905f09c7cc1311794924da103c0673c8268c86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Wed, 1 May 2024 16:27:36 +0800 Subject: [PATCH] feat(wallet): cache txs when constructing full-scan/sync requests --- crates/bdk/src/wallet/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bdk/src/wallet/mod.rs b/crates/bdk/src/wallet/mod.rs index cbe1a82416..24e37884e3 100644 --- a/crates/bdk/src/wallet/mod.rs +++ b/crates/bdk/src/wallet/mod.rs @@ -2419,6 +2419,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, ..) } @@ -2432,6 +2433,7 @@ impl Wallet { /// in which the list of used scripts is not known. pub fn start_full_scan(&self) -> FullScanRequest { FullScanRequest::from_keychain_txout_index(self.chain.tip(), &self.indexed_graph.index) + .cache_graph_txs(self.tx_graph()) } }