refactor on import wallet controllers

This commit is contained in:
Matias Alejo Garcia 2014-11-14 15:05:00 -03:00
commit 45e44fba19
7 changed files with 105 additions and 144 deletions

View file

@ -289,8 +289,8 @@ Identity.prototype.importWalletFromObj = function(obj, opts, cb) {
var w = importFunction(obj, readOpts);
if (!w) return cb(new Error('Could not decrypt'));
this._checkVersion(w.version);
this.addWallet(w);
self._checkVersion(w.version);
self.addWallet(w);
self.bindWallet(w);
self.storeWallet(w, function(err) {
if (err) return cb(err);

View file

@ -2487,7 +2487,8 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
};
/**
* @desc Updates all the indexes for the current publicKeyRing
* @desc Updates all the indexes for the current publicKeyRing. This scans
* the blockchain looking for transactions on derived addresses.
*
* Triggers a wallet {@link Wallet#store} call
* @param {Function} callback - called when all indexes have been updated. Receives an error, if any, as first argument