diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index c427daf71..52d9533f3 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -248,8 +248,10 @@ bool LCTransaction::updateVote(int percentTime, bool proposing) newPosition = weight > AV_INIT_CONSENSUS_PCT; else if (percentTime < AV_LATE_CONSENSUS_TIME) newPosition = weight > AV_MID_CONSENSUS_PCT; - else + else if (percentTime < AV_STUCK_CONSENSUS_TIME) newPosition = weight > AV_LATE_CONSENSUS_PCT; + else + newPosition = weight > AV_STUCK_CONSENSUS_PCT; } else // don't let us outweigh a proposing node, just recognize consensus { @@ -764,8 +766,10 @@ void LedgerConsensus::updateOurPositions() neededWeight = AV_INIT_CONSENSUS_PCT; else if (mClosePercent < AV_LATE_CONSENSUS_TIME) neededWeight = AV_MID_CONSENSUS_PCT; - else + else if (mClosePercent < AV_STUCK_CONSENSUS_TIME) neededWeight = AV_LATE_CONSENSUS_PCT; + else + neededWeight = AV_STUCK_CONSENSUS_TIME; uint32 closeTime = 0; mHaveCloseTimeConsensus = false; diff --git a/src/cpp/ripple/LedgerTiming.h b/src/cpp/ripple/LedgerTiming.h index 821eb6073..1990e61e6 100644 --- a/src/cpp/ripple/LedgerTiming.h +++ b/src/cpp/ripple/LedgerTiming.h @@ -47,6 +47,9 @@ #define AV_LATE_CONSENSUS_TIME 85 // percentage of previous close time before we advance #define AV_LATE_CONSENSUS_PCT 70 // percentage of nodes that most vote yes after advancing +#define AV_STUCK_CONSENSUS_TIME 200 +#define AC_STUCK_CONSENSUS_PCT 95 + class ContinuousLedgerTiming {