diff --git a/lib/chain/chain.js b/lib/chain/chain.js index ac70a02c..5445b196 100644 --- a/lib/chain/chain.js +++ b/lib/chain/chain.js @@ -508,6 +508,9 @@ Chain.prototype.getDeployments = co(function* getDeployments(block, prev, ancest } } + if (this.network.oldWitness) + return state; + // CHECKSEQUENCEVERIFY and median time // past locktimes are now usable (bip9 & bip113). active = yield this.isActive(prev, 'csv'); @@ -520,16 +523,14 @@ Chain.prototype.getDeployments = co(function* getDeployments(block, prev, ancest } // Segregrated witness is now usable (bip141 - segnet4) - if (!this.network.oldWitness) { - active = yield this.isActive(prev, 'witness'); - if (active) { - // BIP147 - // state.flags |= constants.flags.VERIFY_NULLDUMMY; - if (this.options.witness) { - state.flags |= constants.flags.VERIFY_WITNESS; - if (!this.state.hasWitness()) - this.logger.warning('Segwit has been activated.'); - } + active = yield this.isActive(prev, 'witness'); + if (active) { + // BIP147 + // state.flags |= constants.flags.VERIFY_NULLDUMMY; + if (this.options.witness) { + state.flags |= constants.flags.VERIFY_WITNESS; + if (!this.state.hasWitness()) + this.logger.warning('Segwit has been activated.'); } } diff --git a/lib/protocol/networks.js b/lib/protocol/networks.js index 518d8fcd..89edf9ad 100644 --- a/lib/protocol/networks.js +++ b/lib/protocol/networks.js @@ -261,6 +261,30 @@ main.block = { bip34hash: 'b808089c756add1591b1d17bab44bba3fed9e02f942ab4894b02000000000000', + /** + * Height at which bip65 was activated. + */ + + bip65height: 388381, + + /** + * Hash of the block that activated bip65. + */ + + bip65hash: 'f035476cfaeb9f677c2cdad00fd908c556775ded24b6c2040000000000000000', + + /** + * Height at which bip66 was activated. + */ + + bip66height: 363725, + + /** + * Hash of the block that activated bip66. + */ + + bip66hash: '3109b588941188a9f1c2576aae462d729b8cce9da1ea79030000000000000000', + /** * Safe height to start pruning. */ @@ -445,10 +469,10 @@ testnet = network.testnet = {}; testnet.type = 'testnet'; testnet.seeds = [ - 'testnet-seed.alexykot.me', - 'testnet-seed.bitcoin.petertodd.org', - 'testnet-seed.bluematt.me', - 'testnet-seed.bitcoin.schildbach.de' + 'testnet-seed.bitcoin.jonasschnelli.ch', + 'seed.tbtc.petertodd.org', + 'testnet-seed.bluematt.me', + 'testnet-seed.bitcoin.schildbach.de' ]; testnet.magic = 0x0709110b; @@ -524,6 +548,10 @@ testnet.block = { majorityWindow: 100, bip34height: 21111, bip34hash: 'f88ecd9912d00d3f5c2a8e0f50417d3e415c75b3abe584346da9b32300000000', + bip65height: 581885, + bip65hash: 'b61e864fbec41dfaf09da05d1d76dc068b0dd82ee7982ff255667f0000000000', + bip66height: 330776, + bip66hash: '82a14b9e5ea81d4832b8e2cd3c2a6092b5a3853285a8995ec4c8042100000000', pruneAfterHeight: 1000, // maxTipAge: 0x7fffffff maxTipAge: 24 * 60 * 60, @@ -667,6 +695,10 @@ regtest.block = { majorityWindow: 1000, bip34height: -1, bip34hash: null, + bip65height: 1351, + bip65hash: null, + bip66height: 1251, + bip66hash: null, pruneAfterHeight: 1000, maxTipAge: 24 * 60 * 60, slowHeight: 0x7fffffff @@ -805,8 +837,14 @@ segnet3.block = { majorityEnforceUpgrade: 7, majorityRejectOutdated: 9, majorityWindow: 10, - bip34height: -1, - bip34hash: null, + bip34height: 8, + bip34hash: '1c2a2898cebca152f872fa71b756903711ad778c7d63ba6b73c140f800000000', + bip65height: 8, + bip65hash: '1c2a2898cebca152f872fa71b756903711ad778c7d63ba6b73c140f800000000', + bip66height: 8, + bip66hash: '1c2a2898cebca152f872fa71b756903711ad778c7d63ba6b73c140f800000000', + bip141height: 8, + bip141hash: '1c2a2898cebca152f872fa71b756903711ad778c7d63ba6b73c140f800000000', pruneAfterHeight: 1000, // maxTipAge: 0x7fffffff, maxTipAge: 24 * 60 * 60, @@ -921,8 +959,12 @@ segnet4.block = { majorityEnforceUpgrade: 7, majorityRejectOutdated: 9, majorityWindow: 10, - bip34height: -1, - bip34hash: null, + bip34height: 8, + bip34hash: '6c48386dc7c460defabb5640e28b6510a5f238cdbe6756c2976a7e0913000000', + bip65height: 8, + bip65hash: '6c48386dc7c460defabb5640e28b6510a5f238cdbe6756c2976a7e0913000000', + bip66height: 8, + bip66hash: '6c48386dc7c460defabb5640e28b6510a5f238cdbe6756c2976a7e0913000000', pruneAfterHeight: 1000, // maxTipAge: 0x7fffffff, maxTipAge: 24 * 60 * 60, @@ -1059,8 +1101,12 @@ simnet.block = { majorityEnforceUpgrade: 51, majorityRejectOutdated: 75, majorityWindow: 100, - bip34height: -1, - bip34hash: null, + bip34height: 0, + bip34hash: 'f67ad7695d9b662a72ff3d8edbbb2de0bfa67b13974bb9910d116d5cbd863e68', + bip65height: 0, + bip65hash: 'f67ad7695d9b662a72ff3d8edbbb2de0bfa67b13974bb9910d116d5cbd863e68', + bip66height: 0, + bip66hash: 'f67ad7695d9b662a72ff3d8edbbb2de0bfa67b13974bb9910d116d5cbd863e68', pruneAfterHeight: 1000, maxTipAge: 0x7fffffff, slowHeight: 0