Be more robust about storing/replaying proposals:

Store a proposal even if it arrives outside a round. Make sure we catch
up on any missed proposals as we start a round.
This commit is contained in:
JoelKatz
2015-11-02 16:31:18 -08:00
committed by Nik Bougalis
parent 22678b5cfa
commit 9a6a064307
3 changed files with 21 additions and 12 deletions

View File

@@ -300,6 +300,14 @@ LedgerConsensusImp::LedgerConsensusImp (
// update the network status table as to whether we're
// proposing/validating
consensus_.setProposing (mProposing, mValidating);
playbackProposals ();
if (mPeerPositions.size() > (mPreviousProposers / 2))
{
// We may be falling behind, don't wait for the timer
// consider closing the ledger immediately
timerEntry ();
}
}
Json::Value LedgerConsensusImp::getJson (bool full)
@@ -974,8 +982,6 @@ void LedgerConsensusImp::accept (std::shared_ptr<SHAMap> set)
consensus_.takePosition (mPreviousLedger->info().seq, set);
assert (set->getHash () == mOurPosition->getCurrentHash ());
// these are now obsolete
consensus_.peekStoredProposals ().clear ();
}
auto closeTime = mOurPosition->getCloseTime ();