File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed
Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ impl RustImportWalletManager {
120120 . get_all ( network, mode)
121121 . unwrap_or_default ( )
122122 . into_iter ( )
123- . find ( |wallet_metadata| wallet_metadata. wallet_matches_fingerprint ( fingerprint) ) ;
123+ . find ( |wallet_metadata| wallet_metadata. matches_fingerprint ( fingerprint) ) ;
124124
125125 if let Some ( mut metadata) = existing_wallet {
126126 let id = metadata. id . clone ( ) ;
Original file line number Diff line number Diff line change @@ -207,22 +207,9 @@ impl WalletMetadata {
207207 Self { network, verified : true , ..me }
208208 }
209209
210- pub fn wallet_matches_fingerprint ( & self , fingerprint : Fingerprint ) -> bool {
211- if let Some ( saved_fingerprint) = self . master_fingerprint . as_ref ( )
212- && saved_fingerprint. as_ref ( ) == & fingerprint
213- {
214- return true ;
215- }
216-
217- // fallback to check fingerprint with the xpub stored in keychain
218- let xpub = match Keychain :: global ( ) . get_wallet_xpub ( & self . id ) . ok ( ) . flatten ( ) {
219- Some ( xpub) => xpub,
220- None => return false ,
221- } ;
222-
223- let saved_fingerprint = xpub. fingerprint ( ) ;
224- let saved_fingerprint_bytes: & [ u8 ; 4 ] = saved_fingerprint. as_ref ( ) ;
225- saved_fingerprint_bytes == fingerprint. as_ref ( )
210+ pub fn matches_fingerprint ( & self , fingerprint : Fingerprint ) -> bool {
211+ let Some ( wallet_fingerprint) = self . master_fingerprint . as_ref ( ) else { return false } ;
212+ wallet_fingerprint. as_ref ( ) == & fingerprint
226213 }
227214
228215 pub fn preview_new ( ) -> Self {
You can’t perform that action at this time.
0 commit comments