Skip to content

Commit 05870b1

Browse files
committed
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.
1 parent 8789b11 commit 05870b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/validation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <arith_uint256.h>
1212
#include <chain.h>
1313
#include <checkqueue.h>
14-
#include <common/args.h>
1514
#include <consensus/amount.h>
1615
#include <consensus/consensus.h>
1716
#include <consensus/merkle.h>
@@ -2500,7 +2499,7 @@ bool Chainstate::FlushStateToDisk(
25002499
// Write blocks and block index to disk.
25012500
if (fDoFullFlush || fPeriodicWrite) {
25022501
// Ensure we can write block index
2503-
if (!CheckDiskSpace(gArgs.GetBlocksDirPath())) {
2502+
if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) {
25042503
return AbortNode(state, "Disk space is too low!", _("Disk space is too low!"));
25052504
}
25062505
{
@@ -2536,7 +2535,7 @@ bool Chainstate::FlushStateToDisk(
25362535
// twice (once in the log, and once in the tables). This is already
25372536
// an overestimation, as most will delete an existing entry or
25382537
// overwrite one. Still, use a conservative safety factor of 2.
2539-
if (!CheckDiskSpace(gArgs.GetDataDirNet(), 48 * 2 * 2 * CoinsTip().GetCacheSize())) {
2538+
if (!CheckDiskSpace(m_chainman.m_options.datadir, 48 * 2 * 2 * CoinsTip().GetCacheSize())) {
25402539
return AbortNode(state, "Disk space is too low!", _("Disk space is too low!"));
25412540
}
25422541
// Flush the chainstate (which may refer to block index entries).

0 commit comments

Comments
 (0)