@@ -19,6 +19,8 @@ std::optional<ChainstateLoadingError> LoadChainstateSequence(bool fReset,
19
19
int64_t nCoinCacheUsage,
20
20
unsigned int check_blocks,
21
21
unsigned int check_level,
22
+ bool block_tree_db_in_memory,
23
+ bool coins_db_in_memory,
22
24
std::function<int64_t ()> get_unix_time_seconds,
23
25
std::optional<std::function<bool()>> shutdown_requested,
24
26
std::optional<std::function<void()>> coins_error_cb,
@@ -39,7 +41,7 @@ std::optional<ChainstateLoadingError> LoadChainstateSequence(bool fReset,
39
41
// new CBlockTreeDB tries to delete the existing file, which
40
42
// fails if it's still open from the previous loop. Close it first:
41
43
pblocktree.reset ();
42
- pblocktree.reset (new CBlockTreeDB (nBlockTreeDBCache, false , fReset ));
44
+ pblocktree.reset (new CBlockTreeDB (nBlockTreeDBCache, block_tree_db_in_memory , fReset ));
43
45
44
46
if (fReset ) {
45
47
pblocktree->WriteReindexing (true );
@@ -86,7 +88,7 @@ std::optional<ChainstateLoadingError> LoadChainstateSequence(bool fReset,
86
88
for (CChainState* chainstate : chainman.GetAll ()) {
87
89
chainstate->InitCoinsDB (
88
90
/* cache_size_bytes */ nCoinDBCache,
89
- /* in_memory */ false ,
91
+ /* in_memory */ coins_db_in_memory ,
90
92
/* should_wipe */ fReset || fReindexChainState );
91
93
92
94
if (coins_error_cb.has_value ()) {
0 commit comments