mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 06:04:42 +02:00
mining: store block create options in NodeContext
Read configured mining options once during startup instead of parsing options like -blockmaxweight each time a block template is generated. Store the parsed startup options as BlockCreateOptions. Members left unset keep representing unset options; hardcoded defaults are applied by FlattenMiningOptions() before the options are used. IPC overrides and node defaults can then be merged with the same option type used by BlockAssembler. Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
@@ -988,8 +988,7 @@ public:
|
||||
// Also wait during the final catch-up moments after IBD.
|
||||
if (!CooldownIfHeadersAhead(chainman(), notifications(), *maybe_tip, m_interrupt_mining)) return {};
|
||||
}
|
||||
const auto args_options{*Assert(ReadMiningArgs(*Assert(m_node.args)))};
|
||||
const BlockCreateOptions create_options{MergeMiningOptions(options, args_options)};
|
||||
const BlockCreateOptions create_options{MergeMiningOptions(options, m_node.mining_args)};
|
||||
return std::make_unique<BlockTemplateImpl>(create_options,
|
||||
BlockAssembler{
|
||||
chainman().ActiveChainstate(),
|
||||
|
||||
Reference in New Issue
Block a user