@@ -1377,38 +1377,33 @@ export default class HardwareWalletsStore extends Store {
13771377 // @ts -ignore ts-migrate(2339) FIXME: Property 'path' does not exist on type '{}'.
13781378 devicePath = activeDevice . path || path || newConnectionData . path || null ;
13791379
1380- try {
1381- const extendedPublicKey = await this . _requestExtendedPublicKey (
1382- devicePath ,
1383- walletId ,
1384- address
1385- ) ;
1386- const associatedWallet = await this . _findAssociatedWalletByExtendedPublicKey (
1387- { extendedPublicKey }
1388- ) ;
1380+ const extendedPublicKey = await this . _requestExtendedPublicKey (
1381+ devicePath ,
1382+ walletId ,
1383+ address
1384+ ) ;
1385+ const associatedWallet = await this . _findAssociatedWalletByExtendedPublicKey (
1386+ { extendedPublicKey }
1387+ ) ;
13891388
1390- if ( associatedWallet ) {
1391- await this . _storeWalletDataInLocalStorageAndHandleTransactionOrAddressVerificationOrRouting (
1392- {
1393- address,
1394- associatedWallet,
1395- expectedWalletId : walletId ,
1396- extendedPublicKey,
1397- path : devicePath ,
1398- }
1399- ) ;
1400- } else {
1401- logger . debug (
1402- '[HW-DEBUG] HWStore - Software wallet not recognized - Setting error states'
1403- ) ;
1404- this . _discardConnectedDeviceAndReInitiateAddressVerification ( {
1389+ if ( associatedWallet ) {
1390+ await this . _storeWalletDataInLocalStorageAndHandleTransactionOrAddressVerificationOrRouting (
1391+ {
14051392 address,
1406- walletId,
1407- } ) ;
1408- }
1409- } catch ( e ) {
1410- await this . resetWalletPairing ( ) ;
1411- throw e ;
1393+ associatedWallet,
1394+ expectedWalletId : walletId ,
1395+ extendedPublicKey,
1396+ path : devicePath ,
1397+ }
1398+ ) ;
1399+ } else {
1400+ logger . debug (
1401+ '[HW-DEBUG] HWStore - Software wallet not recognized - Setting error states'
1402+ ) ;
1403+ this . _discardConnectedDeviceAndReInitiateAddressVerification ( {
1404+ address,
1405+ walletId,
1406+ } ) ;
14121407 }
14131408 } else {
14141409 logger . debug ( '[HW-DEBUG] Verify Address with Ledger: ' , {
@@ -2771,40 +2766,35 @@ export default class HardwareWalletsStore extends Store {
27712766 }
27722767 ) ;
27732768
2774- try {
2775- const extendedPublicKey = await this . _requestExtendedPublicKey (
2776- transportDevice . path ,
2777- walletId
2769+ const extendedPublicKey = await this . _requestExtendedPublicKey (
2770+ transportDevice . path ,
2771+ walletId
2772+ ) ;
2773+ const associatedWallet = await this . _findAssociatedWalletByExtendedPublicKey (
2774+ { extendedPublicKey }
2775+ ) ;
2776+
2777+ if ( associatedWallet ) {
2778+ await this . _storeWalletDataInLocalStorageAndHandleTransactionOrAddressVerificationOrRouting (
2779+ {
2780+ associatedWallet,
2781+ expectedWalletId : walletId ,
2782+ extendedPublicKey,
2783+ path : transportDevice . path ,
2784+ }
27782785 ) ;
2779- const associatedWallet = await this . _findAssociatedWalletByExtendedPublicKey (
2780- { extendedPublicKey }
2786+ } else {
2787+ const deviceId =
2788+ extendedPublicKey . deviceId || this . transportDevice . deviceId ;
2789+ logger . debug (
2790+ '[HW-DEBUG] HWStore - I don not have recognized wallet - reject TX: ' ,
2791+ {
2792+ deviceId,
2793+ }
27812794 ) ;
27822795
2783- if ( associatedWallet ) {
2784- await this . _storeWalletDataInLocalStorageAndHandleTransactionOrAddressVerificationOrRouting (
2785- {
2786- associatedWallet,
2787- expectedWalletId : walletId ,
2788- extendedPublicKey,
2789- path : transportDevice . path ,
2790- }
2791- ) ;
2792- } else {
2793- const deviceId =
2794- extendedPublicKey . deviceId || this . transportDevice . deviceId ;
2795- logger . debug (
2796- '[HW-DEBUG] HWStore - I don not have recognized wallet - reject TX: ' ,
2797- {
2798- deviceId,
2799- }
2800- ) ;
2801-
2802- // Software Wallet not recognized and TX initiated. Show error
2803- this . _discardConnectedDeviceAndReInitiateTransaction ( { walletId } ) ;
2804- }
2805- } catch ( e ) {
2806- await this . resetWalletPairing ( ) ;
2807- throw e ;
2796+ // Software Wallet not recognized and TX initiated. Show error
2797+ this . _discardConnectedDeviceAndReInitiateTransaction ( { walletId } ) ;
28082798 }
28092799 }
28102800 } else {
0 commit comments