Fixes importing profile with a wallet that is not ready

This commit is contained in:
Matias Pando 2014-11-17 11:46:15 -03:00
commit b9fd442ffd
2 changed files with 4 additions and 3 deletions

View file

@ -2495,8 +2495,9 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
*/ */
Wallet.prototype.updateIndexes = function(callback) { Wallet.prototype.updateIndexes = function(callback) {
var self = this; var self = this;
if (!self.isReady())
return callback();
log.debug('Wallet:' + this.id + ' Updating indexes...'); log.debug('Wallet:' + this.id + ' Updating indexes...');
var tasks = this.publicKeyRing.indexes.map(function(index) { var tasks = this.publicKeyRing.indexes.map(function(index) {
return function(callback) { return function(callback) {
self.updateIndex(index, callback); self.updateIndex(index, callback);