File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,12 @@ impl Wallet {
70
70
/// Build Wallet by loading from persistence.
71
71
//
72
72
// Note that the descriptor secret keys are not persisted to the db.
73
- #[ uniffi:: constructor]
73
+ #[ uniffi:: constructor( default ( lookahead = 25 ) ) ]
74
74
pub fn load (
75
75
descriptor : Arc < Descriptor > ,
76
76
change_descriptor : Arc < Descriptor > ,
77
77
persister : Arc < Persister > ,
78
+ lookahead : u32 ,
78
79
) -> Result < Wallet , LoadWithPersistError > {
79
80
let descriptor = descriptor. to_string_with_secret ( ) ;
80
81
let change_descriptor = change_descriptor. to_string_with_secret ( ) ;
@@ -84,6 +85,7 @@ impl Wallet {
84
85
let wallet: PersistedWallet < PersistenceType > = BdkWallet :: load ( )
85
86
. descriptor ( KeychainKind :: External , Some ( descriptor) )
86
87
. descriptor ( KeychainKind :: Internal , Some ( change_descriptor) )
88
+ . lookahead ( lookahead)
87
89
. extract_keys ( )
88
90
. load_wallet ( deref)
89
91
. map_err ( |e| LoadWithPersistError :: Persist {
@@ -445,7 +447,7 @@ impl Wallet {
445
447
}
446
448
447
449
impl Wallet {
448
- pub ( crate ) fn get_wallet ( & self ) -> MutexGuard < PersistedWallet < PersistenceType > > {
450
+ pub ( crate ) fn get_wallet ( & self ) -> MutexGuard < ' _ , PersistedWallet < PersistenceType > > {
449
451
self . inner_mutex . lock ( ) . expect ( "wallet" )
450
452
}
451
453
}
You can’t perform that action at this time.
0 commit comments