Skip to content

Commit 704ce2e

Browse files
committed
Maintain UTXO Set hash index using Muhash
1 parent 08b0a8a commit 704ce2e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/init.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <httpserver.h>
2323
#include <index/blockfilterindex.h>
2424
#include <index/txindex.h>
25+
#include <index/utxosethash.h>
2526
#include <interfaces/chain.h>
2627
#include <key.h>
2728
#include <miner.h>
@@ -1443,6 +1444,7 @@ bool AppInitMain(InitInterfaces& interfaces)
14431444
filter_index_cache = max_cache / n_indexes;
14441445
nTotalCache -= filter_index_cache * n_indexes;
14451446
}
1447+
int64_t utsh_cache = 0;
14461448
int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); // use 25%-50% of the remainder for disk cache
14471449
nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); // cap total coins db cache
14481450
nTotalCache -= nCoinDBCache;
@@ -1661,6 +1663,9 @@ bool AppInitMain(InitInterfaces& interfaces)
16611663
GetBlockFilterIndex(filter_type)->Start();
16621664
}
16631665

1666+
g_utxo_set_hash = MakeUnique<UtxoSetHash>(utsh_cache, false, fReindex);
1667+
g_utxo_set_hash->Start();
1668+
16641669
// ********************************************************* Step 9: load wallet
16651670
for (const auto& client : interfaces.chain_clients) {
16661671
if (!client->load()) {

0 commit comments

Comments
 (0)