miner: use next deployment state for flags.
This commit is contained in:
parent
5b3ca8ce6f
commit
ef07c52fc6
@ -124,7 +124,7 @@ Miner.prototype.createBlock = co(function* createBlock(tip, address) {
|
|||||||
|
|
||||||
Miner.prototype._createBlock = co(function* createBlock(tip, address) {
|
Miner.prototype._createBlock = co(function* createBlock(tip, address) {
|
||||||
var version = this.options.version;
|
var version = this.options.version;
|
||||||
var ts, mtp, locktime, target, attempt, block;
|
var ts, mtp, locktime, target, attempt, block, state;
|
||||||
|
|
||||||
if (!tip)
|
if (!tip)
|
||||||
tip = this.chain.tip;
|
tip = this.chain.tip;
|
||||||
@ -139,7 +139,9 @@ Miner.prototype._createBlock = co(function* createBlock(tip, address) {
|
|||||||
ts = Math.max(this.network.now(), mtp + 1);
|
ts = Math.max(this.network.now(), mtp + 1);
|
||||||
locktime = ts;
|
locktime = ts;
|
||||||
|
|
||||||
if (this.chain.state.hasMTP())
|
state = yield this.chain.getDeployments(ts, tip);
|
||||||
|
|
||||||
|
if (state.hasMTP())
|
||||||
locktime = mtp;
|
locktime = mtp;
|
||||||
|
|
||||||
target = yield this.chain.getTarget(ts, tip);
|
target = yield this.chain.getTarget(ts, tip);
|
||||||
@ -152,10 +154,10 @@ Miner.prototype._createBlock = co(function* createBlock(tip, address) {
|
|||||||
bits: target,
|
bits: target,
|
||||||
locktime: locktime,
|
locktime: locktime,
|
||||||
mtp: mtp,
|
mtp: mtp,
|
||||||
flags: this.chain.state.flags,
|
flags: state.flags,
|
||||||
address: address,
|
address: address,
|
||||||
coinbaseFlags: this.options.coinbaseFlags,
|
coinbaseFlags: this.options.coinbaseFlags,
|
||||||
witness: this.chain.state.hasWitness(),
|
witness: state.hasWitness(),
|
||||||
interval: this.network.halvingInterval,
|
interval: this.network.halvingInterval,
|
||||||
weight: this.options.reservedWeight,
|
weight: this.options.reservedWeight,
|
||||||
sigops: this.options.reservedSigops
|
sigops: this.options.reservedSigops
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user