aboutsummaryrefslogtreecommitdiff
path: root/src/node/utxo_snapshot.cpp
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2023-05-04 23:19:58 +0200
committerTheCharlatan <seb.kung@gmail.com>2023-05-30 16:52:48 +0200
commit8789b11114b4bd6c7ee727dffbc75a6bdf20dd27 (patch)
treedb12cde890df6de06d2d8982b615f9fbcb02a22d /src/node/utxo_snapshot.cpp
parentef95be334f3aec671346372b64606e0fd390979a (diff)
refactor: Add path argument to FindSnapshotChainstateDir
Remove access to the global gArgs for getting the directory in utxo_snapshot. This is done in the context of the libbitcoinkernel project, wherein reliance of libbitcoinkernel code on the global gArgs is incrementally removed.
Diffstat (limited to 'src/node/utxo_snapshot.cpp')
-rw-r--r--src/node/utxo_snapshot.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/node/utxo_snapshot.cpp b/src/node/utxo_snapshot.cpp
index 3dae46fb84..036a25d0a5 100644
--- a/src/node/utxo_snapshot.cpp
+++ b/src/node/utxo_snapshot.cpp
@@ -4,7 +4,6 @@
#include <node/utxo_snapshot.h>
-#include <common/args.h>
#include <logging.h>
#include <streams.h>
#include <sync.h>
@@ -82,10 +81,10 @@ std::optional<uint256> ReadSnapshotBaseBlockhash(fs::path chaindir)
return base_blockhash;
}
-std::optional<fs::path> FindSnapshotChainstateDir()
+std::optional<fs::path> FindSnapshotChainstateDir(const fs::path& data_dir)
{
fs::path possible_dir =
- gArgs.GetDataDirNet() / fs::u8path(strprintf("chainstate%s", SNAPSHOT_CHAINSTATE_SUFFIX));
+ data_dir / fs::u8path(strprintf("chainstate%s", SNAPSHOT_CHAINSTATE_SUFFIX));
if (fs::exists(possible_dir)) {
return possible_dir;