mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
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.
This commit is contained in:
@@ -5107,7 +5107,7 @@ bool ChainstateManager::ActivateSnapshot(
|
||||
|
||||
// PopulateAndValidateSnapshot can return (in error) before the leveldb datadir
|
||||
// has been created, so only attempt removal if we got that far.
|
||||
if (auto snapshot_datadir = node::FindSnapshotChainstateDir()) {
|
||||
if (auto snapshot_datadir = node::FindSnapshotChainstateDir(m_options.datadir)) {
|
||||
// We have to destruct leveldb::DB in order to release the db lock, otherwise
|
||||
// DestroyDB() (in DeleteCoinsDBFromDisk()) will fail. See `leveldb::~DBImpl()`.
|
||||
// Destructing the chainstate (and so resetting the coinsviews object) does this.
|
||||
@@ -5597,7 +5597,7 @@ ChainstateManager::~ChainstateManager()
|
||||
bool ChainstateManager::DetectSnapshotChainstate(CTxMemPool* mempool)
|
||||
{
|
||||
assert(!m_snapshot_chainstate);
|
||||
std::optional<fs::path> path = node::FindSnapshotChainstateDir();
|
||||
std::optional<fs::path> path = node::FindSnapshotChainstateDir(m_options.datadir);
|
||||
if (!path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user