Skip to content

Commit eca4ca4

Browse files
committed
style-only: Use std::clamp for check_ratio, rename
1 parent fe96a2e commit eca4ca4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/init.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#include <validationinterface.h>
7474
#include <walletinitinterface.h>
7575

76+
#include <algorithm>
7677
#include <condition_variable>
7778
#include <cstdint>
7879
#include <cstdio>
@@ -1418,10 +1419,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14181419

14191420
assert(!node.mempool);
14201421
assert(!node.chainman);
1421-
int check_ratio = std::min<int>(std::max<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
1422+
const int mempool_check_ratio = std::clamp<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0, 1000000);
14221423

14231424
for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) {
1424-
node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), check_ratio);
1425+
node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), mempool_check_ratio);
14251426

14261427
node.chainman = std::make_unique<ChainstateManager>();
14271428
ChainstateManager& chainman = *node.chainman;

0 commit comments

Comments
 (0)