aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-08-05 10:22:31 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-08-05 10:23:01 +0200
commitc9c017adf6a7b78f609f5fc61fd91dfa2e3d9662 (patch)
tree0ce0eca28208905ca3df89f1850a9684abefb50e /src/init.cpp
parent9bb4dd850fae4ecf0ef2b095f198022f136fd659 (diff)
parentf261f19b4b77de7b2769a62356b4e4165cae6dc8 (diff)
Merge pull request #6489
f261f19 Give a better error message if system clock is bad (Casey Rodarmor)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 527133819f..c92e9a7692 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1230,6 +1230,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n",
MIN_BLOCKS_TO_KEEP, GetArg("-checkblocks", 288));
}
+
+ {
+ LOCK(cs_main);
+ CBlockIndex* tip = chainActive.Tip();
+ if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) {
+ strLoadError = _("The block database contains a block which appears to be from the future. "
+ "This may be due to your computer's date and time being set incorrectly. "
+ "Only rebuild the block database if you are sure that your computer's date and time are correct");
+ break;
+ }
+ }
+
if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3),
GetArg("-checkblocks", 288))) {
strLoadError = _("Corrupted block database detected");