Skip to content

Commit 2a2c3c4

Browse files
committed
WIP
1 parent e8f97dd commit 2a2c3c4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/init.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ void SetupServerArgs()
403403
strprintf("Maintain an index of compact filters by block (default: %s, values: %s).", DEFAULT_BLOCKFILTERINDEX, ListBlockFilterTypes()) +
404404
" If <type> is not supplied or if <type> = 1, indexes for all known types are enabled.",
405405
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
406+
gArgs.AddArg("-utxostatsindex", strprintf("Maintain UTXO statistics index, used by the gettxoutset rpc call (default: %u)", DEFAULT_TXINDEX), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
406407

407408
gArgs.AddArg("-addnode=<ip>", "Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info). This option can be specified multiple times to add multiple nodes.", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
408409
gArgs.AddArg("-banscore=<n>", strprintf("Threshold for disconnecting misbehaving peers (default: %u)", DEFAULT_BANSCORE_THRESHOLD), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
@@ -1666,8 +1667,10 @@ bool AppInitMain(NodeContext& node)
16661667
GetBlockFilterIndex(filter_type)->Start();
16671668
}
16681669

1669-
g_utxo_set_hash = MakeUnique<UtxoSetHash>(utsh_cache, false, fReindex);
1670-
g_utxo_set_hash->Start();
1670+
if (gArgs.GetBoolArg("-utxostatsindex", DEFAULT_UTXOSTATSINDEX)) {
1671+
g_utxo_set_hash = MakeUnique<UtxoSetHash>(utsh_cache, false, fReindex);
1672+
g_utxo_set_hash->Start();
1673+
}
16711674

16721675
// ********************************************************* Step 9: load wallet
16731676
for (const auto& client : node.chain_clients) {

src/validation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;
112112

113113
static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
114114
static const bool DEFAULT_TXINDEX = false;
115+
static const bool DEFAULT_UTXOSTATSINDEX = false;
115116
static const char* const DEFAULT_BLOCKFILTERINDEX = "0";
116117
static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100;
117118
/** Default for -persistmempool */

0 commit comments

Comments
 (0)