aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2015-05-13 11:13:13 -0400
committerAlex Morcos <morcos@chaincode.com>2015-05-15 07:58:41 -0400
commitc208040354c9312c7d23c7f26a4d009e775e00ff (patch)
treed7c17ba45bf6980f7e60e3b03a95b04bb0015ef2 /src/main.cpp
parentf0043c2d6d2ceddd631a76b424dd8c163f3dad66 (diff)
downloadbitcoin-c208040354c9312c7d23c7f26a4d009e775e00ff.tar.xz
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5fd9c62486..7d7c97f773 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1886,6 +1886,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
try {
if (fPruneMode && fCheckForPruning) {
FindFilesToPrune(setFilesToPrune);
+ fCheckForPruning = false;
if (!setFilesToPrune.empty()) {
fFlushForPrune = true;
if (!fHavePruned) {
@@ -1942,10 +1943,8 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
}
}
// Finally remove any pruned files
- if (fFlushForPrune) {
+ if (fFlushForPrune)
UnlinkPrunedFiles(setFilesToPrune);
- fCheckForPruning = false;
- }
nLastWrite = nNow;
}
// Flush best chain related state. This can only be done if the blocks / block index write was also done.