network for miner blocks.
This commit is contained in:
parent
3f4e0f5040
commit
2b2a747eab
@ -272,7 +272,8 @@ Miner.prototype.createBlock = function createBlock(version, callback) {
|
|||||||
coinbaseFlags: self.coinbaseFlags,
|
coinbaseFlags: self.coinbaseFlags,
|
||||||
witness: self.chain.segwitActive,
|
witness: self.chain.segwitActive,
|
||||||
parallel: self.options.parallel,
|
parallel: self.options.parallel,
|
||||||
dsha256: self.dsha256
|
dsha256: self.dsha256,
|
||||||
|
network: self.network
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!self.mempool)
|
if (!self.mempool)
|
||||||
@ -366,6 +367,7 @@ function MinerBlock(options) {
|
|||||||
this.witness = options.witness;
|
this.witness = options.witness;
|
||||||
this.address = options.address;
|
this.address = options.address;
|
||||||
this.witnessNonce = null;
|
this.witnessNonce = null;
|
||||||
|
this.network = bcoin.network.get(options.network);
|
||||||
|
|
||||||
// Create a coinbase
|
// Create a coinbase
|
||||||
this.coinbase = new bcoin.mtx();
|
this.coinbase = new bcoin.mtx();
|
||||||
@ -451,7 +453,7 @@ MinerBlock.prototype.updateCommitment = function updateCommitment() {
|
|||||||
|
|
||||||
MinerBlock.prototype.updateCoinbase = function updateCoinbase() {
|
MinerBlock.prototype.updateCoinbase = function updateCoinbase() {
|
||||||
this.coinbase.inputs[0].script[1] = bcoin.script.array(this.extraNonce);
|
this.coinbase.inputs[0].script[1] = bcoin.script.array(this.extraNonce);
|
||||||
this.coinbase.outputs[0].value = this.block.getReward();
|
this.coinbase.outputs[0].value = this.block.getReward(this.network);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user