diff --git a/lib/bcoin/chaindb.js b/lib/bcoin/chaindb.js index 7b8ebec2..804b43de 100644 --- a/lib/bcoin/chaindb.js +++ b/lib/bcoin/chaindb.js @@ -1151,7 +1151,7 @@ ChainDB.prototype.scan = function scan(start, hashes, iter, callback) { for (i = 0; i < hashes.length; i++) hashMap[hashes[i]] = true; - this.logger.info('Rescanning from block %s.', utils.revHex(start)); + this.logger.info('Scanning from block %s.', utils.revHex(start)); (function next(err, hash) { if (err) diff --git a/test/chain-test.js b/test/chain-test.js index 5b36376c..b5076b37 100644 --- a/test/chain-test.js +++ b/test/chain-test.js @@ -218,6 +218,21 @@ describe('Chain', function() { }); }); + it('should rescan for transactions', function(cb) { + var txs = []; + walletdb.getAddresses(function(err, hashes) { + assert.ifError(err); + chain.db.scan(null, hashes, function(tx, block, next) { + txs.push(tx); + next(); + }, function(err) { + assert.ifError(err); + assert.equal(txs.length, 25); + cb(); + }); + }); + }); + it('should cleanup', function(cb) { constants.tx.COINBASE_MATURITY = 100; cb();