Skip to content

Commit c208040

Browse files
committed
Fix for clearing fCheckForPruning
Previously this was cleared only after UnlinkPrunedFiles, but it should really be cleared after FindFilesToPrune, regardless of whether there are any files to be pruned.
1 parent f0043c2 commit c208040

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
18861886
try {
18871887
if (fPruneMode && fCheckForPruning) {
18881888
FindFilesToPrune(setFilesToPrune);
1889+
fCheckForPruning = false;
18891890
if (!setFilesToPrune.empty()) {
18901891
fFlushForPrune = true;
18911892
if (!fHavePruned) {
@@ -1942,10 +1943,8 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
19421943
}
19431944
}
19441945
// Finally remove any pruned files
1945-
if (fFlushForPrune) {
1946+
if (fFlushForPrune)
19461947
UnlinkPrunedFiles(setFilesToPrune);
1947-
fCheckForPruning = false;
1948-
}
19491948
nLastWrite = nNow;
19501949
}
19511950
// Flush best chain related state. This can only be done if the blocks / block index write was also done.

0 commit comments

Comments
 (0)