Skip to content

Commit 51208f2

Browse files
committed
Relocate fCheckForPruning
Once we've called FindFilesToPrune, we don't need to check again.
1 parent a8e9baa commit 51208f2

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
@@ -1887,6 +1887,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
18871887
try {
18881888
if (fPruneMode && fCheckForPruning) {
18891889
FindFilesToPrune(setFilesToPrune);
1890+
fCheckForPruning = false;
18901891
if (!setFilesToPrune.empty()) {
18911892
fFlushForPrune = true;
18921893
if (!fHavePruned) {
@@ -1943,10 +1944,8 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
19431944
}
19441945
}
19451946
// Finally remove any pruned files
1946-
if (fFlushForPrune) {
1947+
if (fFlushForPrune)
19471948
UnlinkPrunedFiles(setFilesToPrune);
1948-
fCheckForPruning = false;
1949-
}
19501949
nLastWrite = nNow;
19511950
}
19521951
// Flush best chain related state. This can only be done if the blocks / block index write was also done.

0 commit comments

Comments
 (0)