Skip to content
Bitcoin Roots

v29.4-roots.2 · Commit 2: [PATCH 02/21] runtime: preserve shared operator controls

src/stats/init.cpp

Before: /dev/null · After: src/stats/init.cpp

File metadata
new file mode 100644
index 0000000000000000000000000000000000000000..c312913744944f636dbf1e534eb74bb018ac759e

Download original patch · Release notes

Diff rows 1–24 of 24. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/stats/init.cpp ADDED
@@ -0,0 +1,24 @@
1
+ // Copyright (c) 2016 The Bitcoin Core developers
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
5
+ #include <stats/stats.h>
6
+
7
+ #include <common/args.h>
8
+ #include <tinyformat.h>
9
+
10
+ void CStats::AddStatsOptions()
11
+ {
12
+ // FIXME: autodetect which default is in use
13
+ // FIXME: ensure we get the correct for multiprocess builds
14
+ gArgs.AddArg("-statsenable", "Enable statistics (default: 1 for GUI, 0 otherwise)", ArgsManager::ALLOW_ANY, OptionsCategory::STATS);
15
+ gArgs.AddArg("-statsmaxmemorytarget=<n>", strprintf("Set the memory limit target for statistics in bytes (default: %u)", DEFAULT_MAX_STATS_MEMORY), ArgsManager::ALLOW_ANY, OptionsCategory::STATS);
16
+ }
17
+
18
+ bool CStats::parameterInteraction()
19
+ {
20
+ if (gArgs.GetBoolArg("-statsenable", DEFAULT_STATISTICS_ENABLED))
21
+ DefaultStats()->setMaxMemoryUsageTarget(gArgs.GetIntArg("-statsmaxmemorytarget", DEFAULT_MAX_STATS_MEMORY));
22
+
23
+ return true;
24
+ }