fix delete wallet

This commit is contained in:
Ivan Socolsky 2014-10-15 15:54:17 -03:00 committed by Matias Alejo Garcia
commit e3107c85ac
3 changed files with 3 additions and 5 deletions

View file

@ -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();
});
});
};