diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-05-04 23:22:33 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-05-30 16:52:50 +0200 |
commit | 05870b1c92f39d90e5ba6e0caf2f6c2b37955528 (patch) | |
tree | 085216c27d025d2371005d3f0311a2f87ddeaa96 /src | |
parent | 8789b11114b4bd6c7ee727dffbc75a6bdf20dd27 (diff) | |
download | bitcoin-05870b1c92f39d90e5ba6e0caf2f6c2b37955528.tar.xz |
refactor: Remove gArgs access from validation.cpp
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')
-rw-r--r-- | src/validation.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 080d426bc3..99495ae2f7 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -11,7 +11,6 @@ #include <arith_uint256.h> #include <chain.h> #include <checkqueue.h> -#include <common/args.h> #include <consensus/amount.h> #include <consensus/consensus.h> #include <consensus/merkle.h> @@ -2500,7 +2499,7 @@ bool Chainstate::FlushStateToDisk( // Write blocks and block index to disk. if (fDoFullFlush || fPeriodicWrite) { // Ensure we can write block index - if (!CheckDiskSpace(gArgs.GetBlocksDirPath())) { + if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) { return AbortNode(state, "Disk space is too low!", _("Disk space is too low!")); } { @@ -2536,7 +2535,7 @@ bool Chainstate::FlushStateToDisk( // twice (once in the log, and once in the tables). This is already // an overestimation, as most will delete an existing entry or // overwrite one. Still, use a conservative safety factor of 2. - if (!CheckDiskSpace(gArgs.GetDataDirNet(), 48 * 2 * 2 * CoinsTip().GetCacheSize())) { + if (!CheckDiskSpace(m_chainman.m_options.datadir, 48 * 2 * 2 * CoinsTip().GetCacheSize())) { return AbortNode(state, "Disk space is too low!", _("Disk space is too low!")); } // Flush the chainstate (which may refer to block index entries). |