network: remove witness field.

This commit is contained in:
Christopher Jeffrey 2017-01-23 03:03:38 -08:00
parent 86b7292c4a
commit 2fdbdfc087
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
6 changed files with 8 additions and 30 deletions

View File

@ -2304,7 +2304,7 @@ function ChainOptions(options) {
this.bufferKeys = !util.isBrowser;
this.spv = false;
this.witness = this.network.witness;
this.witness = true;
this.prune = false;
this.indexTX = false;
this.indexAddress = false;
@ -2327,10 +2327,8 @@ function ChainOptions(options) {
*/
ChainOptions.prototype.fromOptions = function fromOptions(options) {
if (options.network != null) {
if (options.network != null)
this.network = Network.get(options.network);
this.witness = this.network.witness;
}
if (options.logger != null) {
assert(typeof options.logger === 'object');

View File

@ -2159,7 +2159,7 @@ function PeerOptions(options) {
this.noRelay = false;
this.spv = false;
this.compact = false;
this.witness = this.network.witness;
this.witness = true;
this.headers = false;
this.banScore = common.BAN_SCORE;
@ -2183,10 +2183,8 @@ function PeerOptions(options) {
PeerOptions.prototype.fromOptions = function fromOptions(options) {
assert(options, 'Options are required.');
if (options.network != null) {
if (options.network != null)
this.network = Network.get(options.network);
this.witness = this.network.witness;
}
if (options.logger != null) {
assert(typeof options.logger === 'object');

View File

@ -3163,7 +3163,7 @@ function PoolOptions(options) {
this.nonces = new NonceList();
this.address = new NetAddress();
this.witness = this.network.witness;
this.witness = true;
this.useCheckpoints = false;
this.spv = false;
this.listen = false;

View File

@ -39,7 +39,6 @@ function Network(options) {
this.pow = options.pow;
this.block = options.block;
this.bip30 = options.bip30;
this.witness = options.witness;
this.activationThreshold = options.activationThreshold;
this.minerWindow = options.minerWindow;
this.deployments = options.deployments;

View File

@ -180,7 +180,7 @@ main.pow = {
*/
chainwork: new BN(
'0000000000000000000000000000000000000000002cb971dd56d1c583c20f90',
'0000000000000000000000000000000000000000003a315fa3a5ef47f4384cf2',
'hex'
),
@ -309,14 +309,6 @@ main.bip30 = {
91880: '21d77ccb4c08386a04ac0196ae10f6a1d2c2a377558ca190f143070000000000'
};
/**
* Whether this is a segwit-enabled network.
* @const {Boolean}
* @default
*/
main.witness = true;
/**
* For versionbits.
* @const {Number}
@ -548,7 +540,7 @@ testnet.pow = {
),
bits: 486604799,
chainwork: new BN(
'0000000000000000000000000000000000000000000000198b4def2baa9338d6',
'00000000000000000000000000000000000000000000001e345893fa639796e9',
'hex'
),
targetTimespan: 14 * 24 * 60 * 60, // two weeks
@ -573,8 +565,6 @@ testnet.block = {
testnet.bip30 = {};
testnet.witness = true;
testnet.activationThreshold = 1512; // 75% for testchains
testnet.minerWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
@ -724,8 +714,6 @@ regtest.block = {
regtest.bip30 = {};
regtest.witness = false;
regtest.activationThreshold = 108; // 75% for testchains
regtest.minerWindow = 144; // Faster than normal for regtest (144 instead of 2016)
@ -876,8 +864,6 @@ segnet4.block = {
segnet4.bip30 = {};
segnet4.witness = true;
segnet4.activationThreshold = 108;
segnet4.minerWindow = 144;
@ -1020,8 +1006,6 @@ simnet.block = {
simnet.bip30 = {};
simnet.witness = true;
simnet.activationThreshold = 1512; // 75% for testchains
simnet.minerWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing

View File

@ -242,8 +242,7 @@ function defaultOptions() {
if (options.spv)
flags |= 1 << 0;
if (options.witness || options.network.witness)
flags |= 1 << 1;
flags |= 1 << 1;
if (options.prune)
flags |= 1 << 2;