Always pass options to BlockAssembler constructor

This makes the options argument for BlockAssembler constructor mandatory,
dropping implicit use of ArgsManager. The caller i.e. the Mining
interface implementation now handles this.

In a future Stratum v2 change the Options object needs to be
mofified after arguments have been processed. Specifically
the pool communicates how many extra bytes it needs for
its own outputs (payouts, extra commitments, etc). This will need
to be substracted from what the user set as -blockmaxweight.

Such a change can be implemented in createNewBlock, after
ApplyArgsManOptions.
This commit is contained in:
Sjors Provoost
2024-06-10 17:27:12 +02:00
parent 4bf2e361da
commit 64ebb0f971
7 changed files with 15 additions and 16 deletions

View File

@@ -374,7 +374,8 @@ CBlock TestChain100Setup::CreateBlock(
const CScript& scriptPubKey,
Chainstate& chainstate)
{
CBlock block = BlockAssembler{chainstate, nullptr}.CreateNewBlock(scriptPubKey)->block;
BlockAssembler::Options options;
CBlock block = BlockAssembler{chainstate, nullptr, options}.CreateNewBlock(scriptPubKey)->block;
Assert(block.vtx.size() == 1);
for (const CMutableTransaction& tx : txns) {