fix delete wallet
This commit is contained in:
parent
47ae3fcb19
commit
e3107c85ac
3 changed files with 3 additions and 5 deletions
|
|
@ -518,7 +518,6 @@ Identity.prototype.listWallets = function() {
|
|||
*/
|
||||
Identity.prototype.deleteWallet = function(walletId, cb) {
|
||||
var self = this;
|
||||
|
||||
Identity._walletDelete(walletId, this.storage, function(err) {
|
||||
if (err) return cb(err);
|
||||
self.profile.deleteWallet(walletId, function(err) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ Profile.prototype.deleteWallet = function(walletId, cb) {
|
|||
return cb(new Error('WNOEXIST: Wallet not on profile '));
|
||||
|
||||
delete this.walletInfos[walletId];
|
||||
|
||||
this.store({
|
||||
overwrite: true
|
||||
}, cb);
|
||||
|
|
|
|||
|
|
@ -230,11 +230,11 @@ Wallet.getMaxRequiredCopayers = function(totalCopayers) {
|
|||
*/
|
||||
Wallet.delete = function(walletId, storage, cb) {
|
||||
preconditions.checkArgument(cb);
|
||||
|
||||
storage.deletePrefix(Wallet.key(walletId), function(err) {
|
||||
if (err) return cb(err);
|
||||
if (err && err.message != 'not found') return cb(err);
|
||||
storage.deletePrefix(walletId + '::', function(err) {
|
||||
return cb(err);
|
||||
if (err && err.message != 'not found') return cb(err);
|
||||
return cb();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue