merge
This commit is contained in:
commit
cbb8ab415e
2 changed files with 11 additions and 4 deletions
|
|
@ -6,10 +6,15 @@ angular.module('copayApp.controllers').controller('ImportController',
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
var _importBackup = function(encryptedObj) {
|
var _importBackup = function(encryptedObj) {
|
||||||
Passphrase.getBase64Async($scope.password, function(passphrase){
|
Passphrase.getBase64Async($scope.password, function(passphrase){
|
||||||
var w = walletFactory.fromEncryptedObj(encryptedObj, passphrase);
|
var w, errMsg;
|
||||||
|
try {
|
||||||
|
w = walletFactory.fromEncryptedObj(encryptedObj, passphrase);
|
||||||
|
} catch(e) {
|
||||||
|
errMsg = e.message;
|
||||||
|
}
|
||||||
if (!w) {
|
if (!w) {
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$rootScope.$flashMessage = { message: 'Wrong password', type: 'error'};
|
$rootScope.$flashMessage = { message: errMsg || 'Wrong password', type: 'error'};
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,9 @@ Wallet.prototype.getTxProposals = function() {
|
||||||
Wallet.prototype.reject = function(ntxid) {
|
Wallet.prototype.reject = function(ntxid) {
|
||||||
var myId = this.getMyCopayerId();
|
var myId = this.getMyCopayerId();
|
||||||
var txp = this.txProposals.txps[ntxid];
|
var txp = this.txProposals.txps[ntxid];
|
||||||
if (!txp || txp.rejectedBy[myId] || txp.signedBy[myId]) return;
|
if (!txp || txp.rejectedBy[myId] || txp.signedBy[myId]) {
|
||||||
|
throw new Error('Invalid transaction to reject: '+ntxid);
|
||||||
|
}
|
||||||
|
|
||||||
txp.rejectedBy[myId] = Date.now();
|
txp.rejectedBy[myId] = Date.now();
|
||||||
this.sendTxProposals(null, ntxid);
|
this.sendTxProposals(null, ntxid);
|
||||||
|
|
@ -454,7 +456,7 @@ Wallet.prototype.sign = function(ntxid, cb) {
|
||||||
var txp = self.txProposals.txps[ntxid];
|
var txp = self.txProposals.txps[ntxid];
|
||||||
if (!txp || txp.rejectedBy[myId] || txp.signedBy[myId]) {
|
if (!txp || txp.rejectedBy[myId] || txp.signedBy[myId]) {
|
||||||
if (cb) cb(false);
|
if (cb) cb(false);
|
||||||
return;
|
throw new Error('Invalid transaction to sign: '+ntxid);
|
||||||
}
|
}
|
||||||
|
|
||||||
var pkr = self.publicKeyRing;
|
var pkr = self.publicKeyRing;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue