Skip to content

Commit

Permalink
feat(wallet): cache txs when constructing full-scan/sync requests
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed May 1, 2024
1 parent fd576d6 commit 077ea56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bdk/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, ..)
}

Expand All @@ -2432,6 +2433,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())
}
}

Expand Down

0 comments on commit 077ea56

Please sign in to comment.