Merge pull request #2262 from isocolsky/quota

Do not create wallet on storage fail
This commit is contained in:
Matias Alejo Garcia 2015-01-05 10:20:50 -03:00
commit 598dc7bc0e

View file

@ -683,11 +683,13 @@ Identity.prototype.createWallet = function(opts, cb) {
if (self.getWalletById(w.getId())) { if (self.getWalletById(w.getId())) {
return cb('walletAlreadyExists'); return cb('walletAlreadyExists');
} }
self.storeWallet(w, function(err) {
if (err) return cb(err);
self.addWallet(w); self.addWallet(w);
self.updateFocusedTimestamp(w.getId()); self.updateFocusedTimestamp(w.getId());
self.bindWallet(w); self.bindWallet(w);
self.storeWallet(w, function(err) {
if (err) return cb(err);
self.backupNeeded = true; self.backupNeeded = true;
self.store({ self.store({