mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
style-only: Use std::clamp for check_ratio, rename
This commit is contained in:
parent
fe96a2e4bd
commit
eca4ca4d60
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue