@@ -645,7 +645,11 @@ vorpal
645
645
} , function ( result ) {
646
646
if ( result . continue ) {
647
647
if ( currentVote ) {
648
- var unvoteTransaction = arkjs . vote . createVote ( passphrase , [ '-' + currentVote . publicKey ] ) ;
648
+ try {
649
+ var unvoteTransaction = arkjs . vote . createVote ( passphrase , [ '-' + currentVote . publicKey ] ) ;
650
+ } catch ( error ) {
651
+ return seriesCb ( 'Failed: ' + error ) ;
652
+ }
649
653
ledgerSignTransaction ( seriesCb , unvoteTransaction , account , function ( unvoteTransaction ) {
650
654
if ( ! unvoteTransaction ) {
651
655
return seriesCb ( 'Failed to sign unvote transaction with ledger' ) ;
@@ -666,7 +670,11 @@ vorpal
666
670
return seriesCb ( 'Failed to fetch unconfirmed transaction: ' + body . error ) ;
667
671
} else if ( body . transaction ) {
668
672
clearInterval ( checkTransactionTimerId ) ;
669
- var transaction = arkjs . vote . createVote ( passphrase , [ '+' + newDelegate . publicKey ] ) ;
673
+ try {
674
+ var transaction = arkjs . vote . createVote ( passphrase , [ '+' + newDelegate . publicKey ] ) ;
675
+ } catch ( error ) {
676
+ return seriesCb ( 'Failed: ' + error ) ;
677
+ }
670
678
ledgerSignTransaction ( seriesCb , transaction , account , function ( transaction ) {
671
679
if ( ! transaction ) {
672
680
return seriesCb ( 'Failed to sign vote transaction with ledger' ) ;
@@ -679,7 +687,11 @@ vorpal
679
687
} ) ;
680
688
} ) ;
681
689
} else {
682
- var transaction = arkjs . vote . createVote ( passphrase , [ '+' + newDelegate . publicKey ] ) ;
690
+ try {
691
+ var transaction = arkjs . vote . createVote ( passphrase , [ '+' + newDelegate . publicKey ] ) ;
692
+ } catch ( error ) {
693
+ return seriesCb ( 'Failed: ' + error ) ;
694
+ }
683
695
ledgerSignTransaction ( seriesCb , transaction , account , function ( transaction ) {
684
696
if ( ! transaction ) {
685
697
return seriesCb ( 'Failed to sign transaction with ledger' ) ;
@@ -762,7 +774,11 @@ vorpal
762
774
message : 'Removing last vote for ' + lastDelegate . username ,
763
775
} , function ( result ) {
764
776
if ( result . continue ) {
765
- var transaction = arkjs . vote . createVote ( passphrase , delegates ) ;
777
+ try {
778
+ var transaction = arkjs . vote . createVote ( passphrase , delegates ) ;
779
+ } catch ( error ) {
780
+ return seriesCb ( 'Failed: ' + error ) ;
781
+ }
766
782
ledgerSignTransaction ( seriesCb , transaction , account , function ( transaction ) {
767
783
if ( ! transaction ) {
768
784
return seriesCb ( 'Failed to sign transaction with ledger' ) ;
@@ -872,7 +888,11 @@ vorpal
872
888
message : 'Sending ' + arkAmountString + ' ' + network . config . token + ' ' + ( currency ?'(' + currency + args . amount + ') ' :'' ) + 'to ' + args . address + ' now' ,
873
889
} , function ( result ) {
874
890
if ( result . continue ) {
875
- var transaction = arkjs . transaction . createTransaction ( args . address , arkamount , null , passphrase ) ;
891
+ try {
892
+ var transaction = arkjs . transaction . createTransaction ( args . address , arkamount , null , passphrase ) ;
893
+ } catch ( error ) {
894
+ return seriesCb ( 'Failed: ' + error ) ;
895
+ }
876
896
ledgerSignTransaction ( seriesCb , transaction , account , function ( transaction ) {
877
897
if ( ! transaction ) {
878
898
return seriesCb ( 'Failed to sign transaction with ledger' ) ;
@@ -936,7 +956,11 @@ vorpal
936
956
} else {
937
957
return seriesCb ( 'No public key for account' ) ;
938
958
}
939
- var transaction = arkjs . delegate . createDelegate ( passphrase , args . username ) ;
959
+ try {
960
+ var transaction = arkjs . delegate . createDelegate ( passphrase , args . username ) ;
961
+ } catch ( error ) {
962
+ return seriesCb ( 'Failed: ' + error ) ;
963
+ }
940
964
ledgerSignTransaction ( seriesCb , transaction , account , function ( transaction ) {
941
965
if ( ! transaction ) {
942
966
return seriesCb ( 'Failed to sign transaction with ledger' ) ;
0 commit comments