diff --git a/etc/sample.conf b/etc/sample.conf index d2417d30..f8095883 100644 --- a/etc/sample.conf +++ b/etc/sample.conf @@ -22,6 +22,8 @@ db: leveldb # prune: false use-checkpoints: true coin-cache: true +index-tx: false +index-address: false # Mempool # limit-free: true diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 14ce5ae3..8da80d41 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -401,7 +401,7 @@ Chain.prototype.verify = function verify(block, prev, callback) { // Blocks that do not commit to // witness data cannot contain it. - if (!commitmentHash) { + if (!commitmentHash && self.options.witness) { if (block.hasWitness()) { return callback(new VerifyError(block, 'invalid', @@ -540,6 +540,9 @@ Chain.prototype.getDeployments = function getDeployments(block, prev, ancestors, }); }, function(next) { + if (self.network.oldWitness) + return next(); + // Segregrated witness is now usable (bip141 - segnet4) self.isActive(prev, 'witness', function(err, active) { if (err) diff --git a/lib/bcoin/config.js b/lib/bcoin/config.js index e3a786a2..56bb7d08 100644 --- a/lib/bcoin/config.js +++ b/lib/bcoin/config.js @@ -134,6 +134,8 @@ config.parseData = function parseData(data) { options.prune = bool(data.prune); options.useCheckpoints = bool(data.usecheckpoints); options.coinCache = bool(data.coincache); + options.indexTX = bool(data.indextx); + options.indexAddress = bool(data.indexaddress); // Mempool options.limitFree = bool(data.limitfree); diff --git a/lib/bcoin/fullnode.js b/lib/bcoin/fullnode.js index 02d06e1a..fd2e1651 100644 --- a/lib/bcoin/fullnode.js +++ b/lib/bcoin/fullnode.js @@ -64,7 +64,9 @@ function Fullnode(options) { witness: this.options.witness, prune: this.options.prune, useCheckpoints: this.options.useCheckpoints, - coinCache: this.options.coinCache + coinCache: this.options.coinCache, + indexTX: this.options.indexTX, + indexAddress: this.options.indexAddress }); // Fee estimation. @@ -85,7 +87,8 @@ function Fullnode(options) { limitFreeRelay: this.options.limitFreeRelay, requireStandard: this.options.requireStandard, rejectInsaneFees: this.options.rejectInsaneFees, - replaceByFee: this.options.replaceByFee + replaceByFee: this.options.replaceByFee, + indexAddress: this.options.indexAddress }); // Pool needs access to the chain and mempool. diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index 5cbf0689..4c5eb105 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -2112,7 +2112,7 @@ RPC.prototype.dumpwallet = function dumpwallet(args, callback) { address = ring.getAddress('base58'); fmt = '%s %s label= addr=%s'; - if (address.change) + if (ring.change) fmt = '%s %s change=1 addr=%s'; str = utils.fmt(fmt, key.toSecret(), time, address);