From 72b3139becc463f49aef23034397c23aaadafecd Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 18 Aug 2014 20:32:54 +0100 Subject: [PATCH] Disable safe mode around AuxPoW switchover. --- src/main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index c806a80a3..a458c36ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1428,6 +1428,9 @@ bool fLargeWorkForkFound = false; bool fLargeWorkInvalidChainFound = false; CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL; +// Temporarily declare this here so CheckForkWarningConditions() knows it exists +int GetAuxPowStartBlock(); + void CheckForkWarningConditions() { AssertLockHeld(cs_main); @@ -1435,6 +1438,22 @@ void CheckForkWarningConditions() // (we assume we don't get stuck on a fork before the last checkpoint) if (IsInitialBlockDownload()) return; + + // For an hour before, and a day after the AuxPoW hard fork, disable + // warnings. + int proximityToAuxPoWFork = chainActive.Height() - GetAuxPowStartBlock(); + + if (proximityToAuxPoWFork < 0) { + // One hour of one-minute blocks + if (proximityToAuxPoWFork >= -60) { + return; + } + } else { + // 1440 is 24 * 60 (24 hours of one-minute blocks) + if (proximityToAuxPoWFork < 1440) { + return; + } + } // If our best fork is no longer within 360 blocks (+/- 6 hours if no one mines it) // of our head, drop it