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,12 +683,14 @@ Identity.prototype.createWallet = function(opts, cb) {
if (self.getWalletById(w.getId())) { if (self.getWalletById(w.getId())) {
return cb('walletAlreadyExists'); return cb('walletAlreadyExists');
} }
self.addWallet(w);
self.updateFocusedTimestamp(w.getId());
self.bindWallet(w);
self.storeWallet(w, function(err) { self.storeWallet(w, function(err) {
if (err) return cb(err); if (err) return cb(err);
self.addWallet(w);
self.updateFocusedTimestamp(w.getId());
self.bindWallet(w);
self.backupNeeded = true; self.backupNeeded = true;
self.store({ self.store({
noWallets: true, noWallets: true,