miner: expose max-block-weight config option.
This commit is contained in:
parent
386ef622c0
commit
3ec781ee60
@ -469,6 +469,8 @@ Miner.prototype.build = function build(attempt) {
|
|||||||
|
|
||||||
assert(block.getWeight() <= attempt.weight,
|
assert(block.getWeight() <= attempt.weight,
|
||||||
'Block exceeds reserved weight!');
|
'Block exceeds reserved weight!');
|
||||||
|
assert(block.getBaseSize() <= consensus.MAX_BLOCK_SIZE,
|
||||||
|
'Block exceeds max block size.');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -566,12 +568,15 @@ MinerOptions.prototype.fromOptions = function fromOptions(options) {
|
|||||||
|
|
||||||
if (options.maxWeight != null) {
|
if (options.maxWeight != null) {
|
||||||
assert(util.isNumber(options.maxWeight));
|
assert(util.isNumber(options.maxWeight));
|
||||||
|
assert(options.maxWeight <= consensus.MAX_BLOCK_WEIGHT,
|
||||||
|
'Max weight must be below MAX_BLOCK_WEIGHT');
|
||||||
this.maxWeight = options.maxWeight;
|
this.maxWeight = options.maxWeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.maxSigops != null) {
|
if (options.maxSigops != null) {
|
||||||
assert(util.isNumber(options.maxSigops));
|
assert(util.isNumber(options.maxSigops));
|
||||||
assert(options.maxSigops <= consensus.MAX_BLOCK_SIGOPS_COST);
|
assert(options.maxSigops <= consensus.MAX_BLOCK_SIGOPS_COST,
|
||||||
|
'Max sigops must be below MAX_BLOCK_SIGOPS_COST');
|
||||||
this.maxSigops = options.maxSigops;
|
this.maxSigops = options.maxSigops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -281,6 +281,7 @@ config.toOptions = function toOptions(data) {
|
|||||||
// Miner
|
// Miner
|
||||||
options.payoutAddress = list(data.payoutaddress);
|
options.payoutAddress = list(data.payoutaddress);
|
||||||
options.coinbaseFlags = str(data.coinbaseflags);
|
options.coinbaseFlags = str(data.coinbaseflags);
|
||||||
|
options.maxBlockWeight = num(data.maxblockweight);
|
||||||
|
|
||||||
// HTTP
|
// HTTP
|
||||||
options.sslCert = file(data.sslcert, prefix);
|
options.sslCert = file(data.sslcert, prefix);
|
||||||
|
|||||||
@ -119,7 +119,8 @@ function FullNode(options) {
|
|||||||
mempool: this.mempool,
|
mempool: this.mempool,
|
||||||
fees: this.fees,
|
fees: this.fees,
|
||||||
address: this.options.payoutAddress,
|
address: this.options.payoutAddress,
|
||||||
coinbaseFlags: this.options.coinbaseFlags
|
coinbaseFlags: this.options.coinbaseFlags,
|
||||||
|
maxWeight: this.options.maxBlockWeight
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wallet database needs access to fees.
|
// Wallet database needs access to fees.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user