diff options
| author | langerhans <[email protected]> | 2014-08-24 16:58:48 +0200 |
|---|---|---|
| committer | langerhans <[email protected]> | 2014-08-24 16:58:48 +0200 |
| commit | 4642b01f904001d5af09020c73cf3ca2abfc7e82 (patch) | |
| tree | 8b1bcf377be305a81a73e8dd727e008c26c3b7d5 /src/main.cpp | |
| parent | Tweak relese notes to last minute changes (diff) | |
| parent | Disable safe mode around AuxPoW switchover. (diff) | |
| download | discoin-4642b01f904001d5af09020c73cf3ca2abfc7e82.tar.xz discoin-4642b01f904001d5af09020c73cf3ca2abfc7e82.zip | |
Merge pull request #622 from rnicoll/1.8-dev-safemode
Disable safe mode around AuxPoW switchover
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3395395d1..f6e709365 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1434,6 +1434,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); @@ -1441,6 +1444,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 |