diff --git a/lib/bcoin/walletdb.js b/lib/bcoin/walletdb.js index cab6dcab..a6738f7f 100644 --- a/lib/bcoin/walletdb.js +++ b/lib/bcoin/walletdb.js @@ -117,6 +117,12 @@ WalletDB.prototype._init = function _init() { map.all.forEach(function(id) { self.emit(id + ' confirmed', tx); }); + utils.forEachSerial(map.output, function(id, next) { + self.syncOutputDepth(id, tx, next); + }, function(err) { + if (err) + self.emit('error', err); + }); }); this.tx.on('unconfirmed', function(tx, map) { @@ -155,19 +161,7 @@ WalletDB.prototype._init = function _init() { if (err) return self.emit('error', err); - // Only sync for confirmed txs. - if (tx.ts === 0) { - self.emit('balances', balances, map); - return; - } - - utils.forEachSerial(map.output, function(id, next) { - self.syncOutputDepth(id, tx, next); - }, function(err) { - if (err) - self.emit('error', err); - self.emit('balances', balances, map); - }); + self.emit('balances', balances, map); }); }); };