Skip to content

Commit

Permalink
Replace node::BlockAssembler::Options with an alias to node::BlockCre…
Browse files Browse the repository at this point in the history
…ateOptions
  • Loading branch information
luke-jr committed Feb 22, 2025
1 parent e0ee44a commit 41e8069
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/node/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void RegenerateCommitments(CBlock& block, ChainstateManager& chainman)
block.hashMerkleRoot = BlockMerkleRoot(block);
}

BlockAssembler::Options BlockAssembler::Options::Clamped() const
BlockCreateOptions BlockCreateOptions::Clamped() const
{
BlockAssembler::Options options = *this;
constexpr size_t theoretical_min_gentx_sz = 1+4+1+36+1+1+4+1+4;
Expand Down
7 changes: 1 addition & 6 deletions src/node/miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace Consensus { struct Params; };
namespace node { struct NodeContext; };

namespace node {
static const bool DEFAULT_PRINT_MODIFIED_FEE = false;

struct CBlockTemplate
{
Expand Down Expand Up @@ -168,11 +167,7 @@ class BlockAssembler
bool blockFinished;

public:
struct Options : BlockCreateOptions {
bool print_modified_fee{DEFAULT_PRINT_MODIFIED_FEE};

BlockAssembler::Options Clamped() const;
};
using Options = BlockCreateOptions;

explicit BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool, const Options& options, const NodeContext& node);

Expand Down
5 changes: 5 additions & 0 deletions src/node/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ enum class TransactionError {
INVALID_PACKAGE,
};

static const bool DEFAULT_PRINT_MODIFIED_FEE = false;

struct BlockCreateOptions {
/**
* Set false to omit mempool transactions
Expand Down Expand Up @@ -59,6 +61,9 @@ struct BlockCreateOptions {
CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
// Whether to call TestBlockValidity() at the end of CreateNewBlock().
bool test_block_validity{true};
bool print_modified_fee{DEFAULT_PRINT_MODIFIED_FEE};

BlockCreateOptions Clamped() const;

friend bool operator==(const BlockCreateOptions& a, const BlockCreateOptions& b) noexcept = default;
};
Expand Down

0 comments on commit 41e8069

Please sign in to comment.