aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-03-18 17:20:12 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-22 15:43:00 +0200
commit6032f6930a56c107dad8f30c05fec4aab79c8c22 (patch)
tree7fd79172fe0bb65ef533bfb24b00f567d2706930 /src/init.cpp
parentb7dbeb24ebff16198b2925d906c06771e167bd9e (diff)
Add rewind logic to deal with post-fork software updates
Includes logic for dealing with pruning by Suhas Daftuar.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index e924d504bd..5d29f14eb8 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1284,6 +1284,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
break;
}
+ if (!fReindex) {
+ uiInterface.InitMessage(_("Rewinding blocks..."));
+ if (!RewindBlockIndex(chainparams)) {
+ strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain");
+ break;
+ }
+ }
+
uiInterface.InitMessage(_("Verifying blocks..."));
if (fHavePruned && GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks",