switch between wallets in profile working

This commit is contained in:
Matias Alejo Garcia 2014-10-05 15:59:41 -03:00
commit ac491d10b0
19 changed files with 293 additions and 179 deletions

View file

@ -183,12 +183,13 @@ Storage.prototype.delete = function(key, cb) {
};
Storage.prototype.deletePrefix = function(prefix, cb) {
storage.getFirst(prefix, function(err, v, k) {
if (err && !v) return cb(err);
var self = this;
this.getFirst(prefix, function(err, v, k) {
if (err || !v) return cb(err);
storage.delete(k, function(err) {
self.delete(k, function(err) {
if (err) return cb(err);
storage.deletePrefix(prefix, cb);
self.deletePrefix(prefix, cb);
})
});
};