File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2831,7 +2831,6 @@ bool Chainstate::FlushStateToDisk(
2831
2831
try {
2832
2832
{
2833
2833
bool fFlushForPrune = false ;
2834
- bool fDoFullFlush = false ;
2835
2834
2836
2835
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState ();
2837
2836
LOCK (m_blockman.cs_LastBlockFile );
@@ -2887,10 +2886,10 @@ bool Chainstate::FlushStateToDisk(
2887
2886
bool fCacheCritical = mode == FlushStateMode::IF_NEEDED && cache_state >= CoinsCacheSizeState::CRITICAL;
2888
2887
// 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.
2889
2888
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 ;
2892
2891
// Write blocks, block index and best chain related state to disk.
2893
- if (fDoFullFlush ) {
2892
+ if (should_write ) {
2894
2893
// Ensure we can write block index
2895
2894
if (!CheckDiskSpace (m_blockman.m_opts .blocks_dir )) {
2896
2895
return FatalError (m_chainman.GetNotifications (), state, _ (" Disk space is too low!" ));
You can’t perform that action at this time.
0 commit comments