From 3207dbf72830fb3ffa328d4fb25955d05e8e61ea Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 27 Jul 2015 15:06:24 +0100 Subject: [PATCH] Add chain height when fetching consensus parameters in initialization Add chain height when fetching consensus parameters in initialization, this code was missed in the first patch as it was disabled at the time. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index a49406ec1..88a716a5a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1422,7 +1422,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) StartNode(threadGroup, scheduler); // Monitor the chain, and alert if we get blocks much quicker or slower than expected - int64_t nPowTargetSpacing = Params().GetConsensus().nPowTargetSpacing; + int64_t nPowTargetSpacing = Params().GetConsensus(chainActive.Height()).nPowTargetSpacing; CScheduler::Function f = boost::bind(&PartitionCheck, &IsInitialBlockDownload, boost::ref(cs_main), boost::cref(pindexBestHeader), nPowTargetSpacing); scheduler.scheduleEvery(f, nPowTargetSpacing);