Skip to content

Commit b557fa7

Browse files
committed
refactor: rename fDoFullFlush to should_write
1 parent d73bd9f commit b557fa7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/validation.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,6 @@ bool Chainstate::FlushStateToDisk(
28312831
try {
28322832
{
28332833
bool fFlushForPrune = false;
2834-
bool fDoFullFlush = false;
28352834

28362835
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState();
28372836
LOCK(m_blockman.cs_LastBlockFile);
@@ -2887,10 +2886,10 @@ bool Chainstate::FlushStateToDisk(
28872886
bool fCacheCritical = mode == FlushStateMode::IF_NEEDED && cache_state >= CoinsCacheSizeState::CRITICAL;
28882887
// It's been a while since we wrote the block index and chain state to disk. Do this frequently, so we don't need to redownload or reindex after a crash.
28892888
bool fPeriodicWrite = mode == FlushStateMode::PERIODIC && nNow > m_last_write + DATABASE_WRITE_INTERVAL;
2890-
// Combine all conditions that result in a full cache flush.
2891-
fDoFullFlush = (mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicWrite || fFlushForPrune;
2889+
// Combine all conditions that result in a write to disk.
2890+
bool should_write = (mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicWrite || fFlushForPrune;
28922891
// Write blocks, block index and best chain related state to disk.
2893-
if (fDoFullFlush) {
2892+
if (should_write) {
28942893
// Ensure we can write block index
28952894
if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) {
28962895
return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));

0 commit comments

Comments
 (0)