1671 | @@ -1672,7 +1672,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
1672 | int64_t nPowTargetSpacing = Params().GetConsensus().nPowTargetSpacing;
1673 | CScheduler::Function f = boost::bind(&PartitionCheck, &IsInitialBlockDownload,
1674 | boost::ref(cs_main), boost::cref(pindexBestHeader), nPowTargetSpacing);
1675 | - scheduler.scheduleEvery(f, nPowTargetSpacing);
1676 | + CBlockIndex *pdummy = NULL;
1677 | + scheduler.scheduleEvery(f, PartitionCheck(&IsInitialBlockDownload, boost::ref(cs_main), boost::cref(pdummy), nPowTargetSpacing));
It took me a while to understand this, with PartitionCheck called once as the scheduled function, and once specially to determine the frequency.
Wouldn't it be easy to just schedule it once, and have each invocation schedule its own next call? That way the interval cal also be made dynamic more easily.
I did this just to keep the constants out of global scope, which would probably be more readable. A drawback of constant rescheduling would be some drift, probably not much.