Skip to content

Commit 51c7a41

Browse files
committed
init: Only determine maxmempool once
Now that MemPoolOptions has a correctly-determined max_size member, use that instead of redetermining it to print the log line.
1 parent 386c947 commit 51c7a41

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/init.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14131413
// cache size calculations
14141414
CacheSizes cache_sizes = CalculateCacheSizes(args, g_enabled_filter_types.size());
14151415

1416-
int64_t nMempoolSizeMax = args.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE_MB) * 1000000;
14171416
LogPrintf("Cache configuration:\n");
14181417
LogPrintf("* Using %.1f MiB for block index database\n", cache_sizes.block_tree_db * (1.0 / 1024 / 1024));
14191418
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
@@ -1424,7 +1423,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14241423
cache_sizes.filter_index * (1.0 / 1024 / 1024), BlockFilterTypeName(filter_type));
14251424
}
14261425
LogPrintf("* Using %.1f MiB for chain state database\n", cache_sizes.coins_db * (1.0 / 1024 / 1024));
1427-
LogPrintf("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)\n", cache_sizes.coins * (1.0 / 1024 / 1024), nMempoolSizeMax * (1.0 / 1024 / 1024));
14281426

14291427
assert(!node.mempool);
14301428
assert(!node.chainman);
@@ -1435,6 +1433,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14351433
};
14361434
ApplyArgsManOptions(args, mempool_opts);
14371435
mempool_opts.check_ratio = std::clamp<int>(mempool_opts.check_ratio, 0, 1'000'000);
1436+
LogPrintf("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)\n", cache_sizes.coins * (1.0 / 1024 / 1024), mempool_opts.max_size_bytes * (1.0 / 1024 / 1024));
14381437

14391438
for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) {
14401439
node.mempool = std::make_unique<CTxMemPool>(mempool_opts);

0 commit comments

Comments
 (0)