mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
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.
This commit is contained in:
parent
8789b11114
commit
05870b1c92
1 changed files with 2 additions and 3 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Reference in a new issue