Change rule slightly if consensus seems stuck.

This commit is contained in:
JoelKatz
2013-02-10 13:23:11 -08:00
parent 7710f82b2b
commit 8653d679b3
2 changed files with 9 additions and 2 deletions

View File

@@ -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;

View File

@@ -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
{