aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-02-22 14:20:55 -0500
committerCarl Dong <contact@carldong.me>2022-04-27 11:09:05 -0400
commitfe96a2e4bd87768df8001eb4117926a0977d876e (patch)
tree9e91a743187a66e9f38093738d2535ac721cf241
parent5921b863e39e5c3997895ffee1c87159e37a5d6f (diff)
style-only: Use for instead of when loading Chainstate
It's a bit clearer and restricts the scope of fLoaded
-rw-r--r--src/init.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 11d2b61da8..6ea25bc36d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1420,8 +1420,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
assert(!node.chainman);
int check_ratio = std::min<int>(std::max<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
- bool fLoaded = false;
- while (!fLoaded && !ShutdownRequested()) {
+ for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) {
node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), check_ratio);
node.chainman = std::make_unique<ChainstateManager>();