Skip to content

Commit 9b4107a

Browse files
feat: implement set_lookahead_for_all on wallet
1 parent d9dd951 commit 9b4107a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/bdk/src/wallet/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,15 @@ impl<D> Wallet<D> {
19861986
pub fn local_chain(&self) -> &LocalChain {
19871987
&self.chain
19881988
}
1989+
1990+
/// Set lookahead for all keychains.
1991+
pub fn set_lookahead_for_all(&mut self, lookahead: u32) {
1992+
// Having a lookahead of 0, means if we sync the chain
1993+
// we would not find any update since we don't have any
1994+
// store scripts in our indexer.
1995+
assert_ne!(lookahead, 0, "lookahead must be greater than 0");
1996+
self.indexed_graph.index.set_lookahead_for_all(lookahead);
1997+
}
19891998
}
19901999

19912000
impl<D> AsRef<bdk_chain::tx_graph::TxGraph<ConfirmationTimeAnchor>> for Wallet<D> {

0 commit comments

Comments
 (0)