mirror of https://github.com/BTCPrivate/copay.git
Delete entry with a wrong signature
This commit is contained in:
parent
313fcd4808
commit
c83e0c73da
|
@ -194,6 +194,9 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
var w = $rootScope.wallet;
|
||||
var sign = w.verifySignAddressBook(key);
|
||||
$scope.signAddressBook[key] = sign;
|
||||
if (!sign) {
|
||||
notification.error('Wrong signature', 'Entry of Addressbooks was deleted');
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -861,7 +861,13 @@ Wallet.prototype.verifySignAddressBook = function(key) {
|
|||
copayerId: this.addressBook[key].copayerId,
|
||||
createdTs: this.addressBook[key].createdTs
|
||||
};
|
||||
return this.verifySignedObject(payload, signature);
|
||||
var sign = this.verifySignedObject(payload, signature);
|
||||
if (!sign) {
|
||||
// remove wrong signed entry
|
||||
delete this.addressBook[key];
|
||||
this.store();
|
||||
}
|
||||
return sign;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue