mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 06:04:42 +02:00
miner: add block_max_weight to BlockCreateOptions
This new optional replaces nBlockMaxWeight. Use uint64_t for the block weight options to match BlockAssembler's nBlockWeight accounting and the IPC schema's blockReservedWeight type. A negative -blockmaxweight value is now parsed as 0 instead of an overflowed signed value before validation rejects it. The new block_max_weight option is not exposed to IPC clients.
This commit is contained in:
@@ -94,7 +94,7 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, Cha
|
||||
WITH_LOCK(::cs_main, tx_pool.check(chainstate.CoinsTip(), chainstate.m_chain.Height() + 1));
|
||||
{
|
||||
BlockAssembler::Options options;
|
||||
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
|
||||
options.block_max_weight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
|
||||
options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
|
||||
auto assembler = BlockAssembler{chainstate, &tx_pool, options};
|
||||
auto block_template = assembler.CreateNewBlock();
|
||||
|
||||
Reference in New Issue
Block a user