feat(wallet): cache txs when constructing full-scan/sync requests

This commit is contained in:
志宇 2024-05-01 16:27:36 +08:00
parent 58f27b38eb
commit 653e4fed6d
No known key found for this signature in database
GPG Key ID: F6345C9837C2BDE8

View 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())
}
}