fullnode: add noScan option.

This commit is contained in:
Christopher Jeffrey 2016-08-11 17:42:47 -07:00
parent 870f6e65b4
commit c582a0fad8
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 5 additions and 0 deletions

View File

@ -136,6 +136,7 @@ config.parseData = function parseData(data) {
options.coinCache = bool(data.coincache);
options.indexTX = bool(data.indextx);
options.indexAddress = bool(data.indexaddress);
options.noScan = bool(data.noscan);
// Mempool
options.limitFree = bool(data.limitfree);

View File

@ -297,6 +297,10 @@ Fullnode.prototype._open = function open(callback) {
});
},
function(next) {
if (self.options.noScan) {
self.walletdb.tx.writeTip(self.chain.tip.hash, next);
return next();
}
// Always rescan to make sure we didn't miss anything:
// there is no atomicity between the chaindb and walletdb.
self.walletdb.rescan(self.chain.db, next);