rm copayers first

This commit is contained in:
Matias Alejo Garcia 2015-02-09 18:26:25 -03:00
parent b19d12157a
commit 1ab279ab15
1 changed files with 4 additions and 5 deletions

View File

@ -241,7 +241,7 @@ Storage.prototype._removeCopayers = function(walletId, cb) {
var self = this;
this.fetchWallet(walletId, function(err, w) {
if (err) return cb(err);
if (err || !w) return cb(err);
self.db.batch(_.map(w.copayers, function(c) {
return {
@ -262,7 +262,9 @@ Storage.prototype.removeWallet = function(walletId, cb) {
var self = this;
async.series([
function(next) {
self._removeCopayers(walletId, next);
},
function(next) {
self._removeAllAddresses(walletId, next);
},
@ -272,9 +274,6 @@ Storage.prototype.removeWallet = function(walletId, cb) {
function(next) {
self.removeAllTxs(walletId, next);
},
function(next) {
self._removeCopayers(walletId, next);
},
function(next) {
var ops = [{
type: 'del',