diff options
Diffstat (limited to 'src/versionbits.cpp')
-rw-r--r-- | src/versionbits.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/versionbits.cpp b/src/versionbits.cpp index df666c963f..df2ec4e056 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -57,18 +57,12 @@ ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* switch (state) { case ThresholdState::DEFINED: { - if (pindexPrev->GetMedianTimePast() >= nTimeTimeout) { - stateNext = ThresholdState::FAILED; - } else if (pindexPrev->GetMedianTimePast() >= nTimeStart) { + if (pindexPrev->GetMedianTimePast() >= nTimeStart) { stateNext = ThresholdState::STARTED; } break; } case ThresholdState::STARTED: { - if (pindexPrev->GetMedianTimePast() >= nTimeTimeout) { - stateNext = ThresholdState::FAILED; - break; - } // We need to count const CBlockIndex* pindexCount = pindexPrev; int count = 0; @@ -80,6 +74,8 @@ ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* } if (count >= nThreshold) { stateNext = ThresholdState::LOCKED_IN; + } else if (pindexPrev->GetMedianTimePast() >= nTimeTimeout) { + stateNext = ThresholdState::FAILED; } break; } |