balance Service

This commit is contained in:
Matias Alejo Garcia 2014-11-29 18:35:48 -03:00
commit 57299d675e
31 changed files with 585 additions and 645 deletions

View file

@ -172,11 +172,7 @@ Identity.prototype.retrieveWalletFromStorage = function(walletId, opts, callback
blockchainOpts: self.blockchainOpts,
skipFields: []
};
return callback(null, importFunction(walletData, readOpts));
} catch (e) {
log.debug("ERROR: ", e.message);
if (e && e.message && e.message.indexOf('MISSOPTS') !== -1) {
return callback(new Error('WERROR: Could not read: ' + walletId + ': ' + e.message));
@ -184,6 +180,7 @@ Identity.prototype.retrieveWalletFromStorage = function(walletId, opts, callback
return callback(e);
}
}
return callback(null, importFunction(walletData, readOpts));
});
};
@ -564,6 +561,9 @@ Identity.prototype.listWallets = function() {
Identity.prototype.deleteWallet = function(walletId, cb) {
var self = this;
var w = this.getWalletById(walletId);
w.close();
delete this.wallets[walletId];
this.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
if (err) {