File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1986,6 +1986,20 @@ impl<D> Wallet<D> {
19861986 pub fn local_chain ( & self ) -> & LocalChain {
19871987 & self . chain
19881988 }
1989+
1990+ /// Set lookahead for all keychains.
1991+ ///
1992+ /// Passing a lookahead of 0 will result in an error. This is because if we sync
1993+ /// the chain with a lookahead of 0, we would not find any update since we don't
1994+ /// have any scripts stored.
1995+ pub fn set_lookahead_for_all ( & mut self , lookahead : u32 ) -> Result < ( ) , Error > {
1996+ if lookahead == 0 {
1997+ return Err ( Error :: Generic (
1998+ "lookahead must be greater than 0" . to_string ( ) ,
1999+ ) ) ;
2000+ }
2001+ Ok ( self . indexed_graph . index . set_lookahead_for_all ( lookahead) )
2002+ }
19892003}
19902004
19912005impl < D > AsRef < bdk_chain:: tx_graph:: TxGraph < ConfirmationTimeAnchor > > for Wallet < D > {
You can’t perform that action at this time.
0 commit comments