mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
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.
This commit is contained in:
parent
386c9472c8
commit
51c7a41a5e
1 changed files with 1 additions and 2 deletions
|
@ -1413,7 +1413,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
// cache size calculations
|
// cache size calculations
|
||||||
CacheSizes cache_sizes = CalculateCacheSizes(args, g_enabled_filter_types.size());
|
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("Cache configuration:\n");
|
||||||
LogPrintf("* Using %.1f MiB for block index database\n", cache_sizes.block_tree_db * (1.0 / 1024 / 1024));
|
LogPrintf("* Using %.1f MiB for block index database\n", cache_sizes.block_tree_db * (1.0 / 1024 / 1024));
|
||||||
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
|
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));
|
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 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.mempool);
|
||||||
assert(!node.chainman);
|
assert(!node.chainman);
|
||||||
|
@ -1435,6 +1433,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
};
|
};
|
||||||
ApplyArgsManOptions(args, mempool_opts);
|
ApplyArgsManOptions(args, mempool_opts);
|
||||||
mempool_opts.check_ratio = std::clamp<int>(mempool_opts.check_ratio, 0, 1'000'000);
|
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();) {
|
for (bool fLoaded = false; !fLoaded && !ShutdownRequested();) {
|
||||||
node.mempool = std::make_unique<CTxMemPool>(mempool_opts);
|
node.mempool = std::make_unique<CTxMemPool>(mempool_opts);
|
||||||
|
|
Loading…
Add table
Reference in a new issue