@@ -11,6 +11,7 @@ use alloc::collections::BTreeMap;
1111use alloc:: string:: String ;
1212use alloc:: vec:: Vec ;
1313use dashcore:: blockdata:: transaction:: Transaction ;
14+ use dashcore:: prelude:: CoreBlockHeight ;
1415use dashcore:: { BlockHash , Txid } ;
1516use key_wallet:: account:: AccountCollection ;
1617use key_wallet:: transaction_checking:: TransactionContext ;
@@ -121,7 +122,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
121122 mnemonic : & str ,
122123 passphrase : & str ,
123124 network : Network ,
124- birth_height : Option < u32 > ,
125+ birth_height : CoreBlockHeight ,
125126 account_creation_options : key_wallet:: wallet:: initialization:: WalletAccountCreationOptions ,
126127 ) -> Result < WalletId , WalletError > {
127128 let mnemonic_obj = Mnemonic :: from_phrase ( mnemonic, key_wallet:: mnemonic:: Language :: English )
@@ -178,7 +179,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
178179 /// * `mnemonic` - The mnemonic phrase
179180 /// * `passphrase` - Optional BIP39 passphrase (empty string for no passphrase)
180181 /// * `network` - The network for the wallet
181- /// * `birth_height` - Optional birth height for wallet scanning
182+ /// * `birth_height` - Birth height for wallet scanning (0 to sync from genesis)
182183 /// * `account_creation_options` - Which accounts to create initially
183184 /// * `downgrade_to_pubkey_wallet` - If true, creates a wallet without private keys
184185 /// * `allow_external_signing` - If true and downgraded, creates an externally signable wallet (e.g., for hardware wallets)
@@ -198,7 +199,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
198199 mnemonic : & str ,
199200 passphrase : & str ,
200201 network : Network ,
201- birth_height : Option < u32 > ,
202+ birth_height : CoreBlockHeight ,
202203 account_creation_options : key_wallet:: wallet:: initialization:: WalletAccountCreationOptions ,
203204 downgrade_to_pubkey_wallet : bool ,
204205 allow_external_signing : bool ,
@@ -302,7 +303,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
302303 // Create managed wallet info
303304 let mut managed_info = T :: from_wallet ( & wallet) ;
304305 let network_state = self . get_or_create_network_state ( network) ;
305- managed_info. set_birth_height ( Some ( network_state. current_height ) ) ;
306+ managed_info. set_birth_height ( network_state. current_height ) ;
306307 managed_info. set_first_loaded_at ( current_timestamp ( ) ) ;
307308
308309 self . wallets . insert ( wallet_id, wallet) ;
@@ -396,8 +397,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
396397
397398 // Create managed wallet info
398399 let mut managed_info = T :: from_wallet ( & wallet) ;
399- managed_info
400- . set_birth_height ( Some ( self . get_or_create_network_state ( network) . current_height ) ) ;
400+ managed_info. set_birth_height ( self . get_or_create_network_state ( network) . current_height ) ;
401401 managed_info. set_first_loaded_at ( current_timestamp ( ) ) ;
402402
403403 self . wallets . insert ( wallet_id, wallet) ;
@@ -446,8 +446,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
446446
447447 // Create managed wallet info
448448 let mut managed_info = T :: from_wallet ( & wallet) ;
449- managed_info
450- . set_birth_height ( Some ( self . get_or_create_network_state ( network) . current_height ) ) ;
449+ managed_info. set_birth_height ( self . get_or_create_network_state ( network) . current_height ) ;
451450 managed_info. set_first_loaded_at ( current_timestamp ( ) ) ;
452451
453452 self . wallets . insert ( wallet_id, wallet) ;
@@ -492,7 +491,7 @@ impl<T: WalletInfoInterface> WalletManager<T> {
492491
493492 // Use the current network's height as the birth height since we don't know when it was originally created
494493 let network_state = self . get_or_create_network_state ( wallet. network ) ;
495- managed_info. set_birth_height ( Some ( network_state. current_height ) ) ;
494+ managed_info. set_birth_height ( network_state. current_height ) ;
496495 managed_info. set_first_loaded_at ( current_timestamp ( ) ) ;
497496
498497 self . wallets . insert ( wallet_id, wallet) ;
0 commit comments