diff --git a/src/init.cpp b/src/init.cpp index c9405153b47..be7217da5c8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -128,7 +128,7 @@ using node::BlockManager; using node::CacheSizes; using node::CalculateCacheSizes; using node::DEFAULT_PERSIST_MEMPOOL; -using node::DEFAULT_PRINTPRIORITY; +using node::DEFAULT_PRINT_MODIFIED_FEE; using node::DEFAULT_STOPATHEIGHT; using node::KernelNotifications; using node::LoadChainstate; @@ -624,7 +624,7 @@ void SetupServerArgs(ArgsManager& argsman) strprintf("Maximum tip age in seconds to consider node in initial block download (default: %u)", Ticks(DEFAULT_MAX_TIP_AGE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); - argsman.AddArg("-printpriority", strprintf("Log transaction fee rate in " + CURRENCY_UNIT + "/kvB when mining blocks (default: %u)", DEFAULT_PRINTPRIORITY), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); + argsman.AddArg("-printpriority", strprintf("Log transaction fee rate in " + CURRENCY_UNIT + "/kvB when mining blocks (default: %u)", DEFAULT_PRINT_MODIFIED_FEE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-uacomment=", "Append comment to the user agent string", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); SetupChainParamsBaseOptions(argsman); diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 03c6d74deba..291f1d5fc7f 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -79,6 +79,7 @@ void ApplyArgsManOptions(const ArgsManager& args, BlockAssembler::Options& optio if (const auto blockmintxfee{args.GetArg("-blockmintxfee")}) { if (const auto parsed{ParseMoney(*blockmintxfee)}) options.blockMinFeeRate = CFeeRate{*parsed}; } + options.print_modified_fee = args.GetBoolArg("-printpriority", options.print_modified_fee); } void BlockAssembler::resetBlock() @@ -222,8 +223,7 @@ void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) nFees += iter->GetFee(); inBlock.insert(iter->GetSharedTx()->GetHash()); - bool fPrintPriority = gArgs.GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY); - if (fPrintPriority) { + if (m_options.print_modified_fee) { LogPrintf("fee rate %s txid %s\n", CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(), iter->GetTx().GetHash().ToString()); diff --git a/src/node/miner.h b/src/node/miner.h index c3178a7532b..622ca16c8fd 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -30,7 +30,7 @@ class ChainstateManager; namespace Consensus { struct Params; }; namespace node { -static const bool DEFAULT_PRINTPRIORITY = false; +static const bool DEFAULT_PRINT_MODIFIED_FEE = false; struct CBlockTemplate { @@ -159,6 +159,7 @@ public: 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}; }; explicit BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool, const Options& options);