diff options
author | Carl Dong <contact@carldong.me> | 2022-05-18 11:48:29 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-06-28 15:39:31 -0400 |
commit | 51c7a41a5eb6fcb60333812c770d80227cf7b64d (patch) | |
tree | 7685046b0be97b6f060241aedb8ffd7830151c93 | |
parent | 386c9472c8764738282e6d163b42e15a8feda7ea (diff) | |
download | bitcoin-51c7a41a5eb6fcb60333812c770d80227cf7b64d.tar.xz |
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.
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 3ad4dc2667..efbc9f41d9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1413,7 +1413,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) // cache size calculations CacheSizes cache_sizes = CalculateCacheSizes(args, g_enabled_filter_types.size()); - int64_t nMempoolSizeMax = args.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE_MB) * 1000000; LogPrintf("Cache configuration:\n"); LogPrintf("* Using %.1f MiB for block index database\n", cache_sizes.block_tree_db * (1.0 / 1024 / 1024)); if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { @@ -1424,7 +1423,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) cache_sizes.filter_index * (1.0 / 1024 / 1024), BlockFilterTypeName(filter_type)); } LogPrintf("* Using %.1f MiB for chain state database\n", cache_sizes.coins_db * (1.0 / 1024 / 1024)); - 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)); assert(!node.mempool); assert(!node.chainman); @@ -1435,6 +1433,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) }; ApplyArgsManOptions(args, mempool_opts); mempool_opts.check_ratio = std::clamp<int>(mempool_opts.check_ratio, 0, 1'000'000); + 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)); for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) { node.mempool = std::make_unique<CTxMemPool>(mempool_opts); |