diff options
author | Carl Dong <contact@carldong.me> | 2022-02-22 14:30:31 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-04-27 11:13:32 -0400 |
commit | eca4ca4d60599c9dbdd4e03a73beb33e9b44655a (patch) | |
tree | d5cadf5ac6c992a77f766b7e816e7478a075d55e /src/init.cpp | |
parent | fe96a2e4bd87768df8001eb4117926a0977d876e (diff) | |
download | bitcoin-eca4ca4d60599c9dbdd4e03a73beb33e9b44655a.tar.xz |
style-only: Use std::clamp for check_ratio, rename
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 6ea25bc36d..fdcb2b8ac7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -73,6 +73,7 @@ #include <validationinterface.h> #include <walletinitinterface.h> +#include <algorithm> #include <condition_variable> #include <cstdint> #include <cstdio> @@ -1418,10 +1419,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) assert(!node.mempool); assert(!node.chainman); - int check_ratio = std::min<int>(std::max<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000); + const int mempool_check_ratio = std::clamp<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0, 1000000); for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) { - node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), check_ratio); + node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), mempool_check_ratio); node.chainman = std::make_unique<ChainstateManager>(); ChainstateManager& chainman = *node.chainman; |