Merge pull request #433 from isocolsky/fix/2-step
Fix 2-step balance computation
This commit is contained in:
commit
46c92e2248
|
@ -1059,9 +1059,9 @@ WalletService.prototype._getActiveAddresses = function(cb) {
|
|||
var result = _.union(active, recent);
|
||||
|
||||
var index = _.indexBy(allAddresses, 'address');
|
||||
result = _.map(result, function(r) {
|
||||
result = _.compact(_.map(result, function(r) {
|
||||
return index[r];
|
||||
});
|
||||
}));
|
||||
return cb(null, result);
|
||||
});
|
||||
});
|
||||
|
@ -1101,7 +1101,9 @@ WalletService.prototype.getBalance = function(opts, cb) {
|
|||
if (err) return;
|
||||
if (!_.isEqual(partialBalance, fullBalance)) {
|
||||
log.debug('Cache miss: balance in active addresses differs from final balance');
|
||||
self._notify('BalanceUpdated', fullBalance);
|
||||
self._notify('BalanceUpdated', fullBalance, {
|
||||
isGlobal: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1);
|
||||
|
|
Loading…
Reference in New Issue