Prevent some missed proposals, faster consensus catch up

This commit is contained in:
JoelKatz
2015-11-03 13:45:27 -08:00
parent d20f0d5014
commit 3d5ff2b4cd
2 changed files with 10 additions and 4 deletions

View File

@@ -298,6 +298,13 @@ 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
timerEntry ();
}
}
Json::Value LedgerConsensusImp::getJson (bool full)
@@ -976,8 +983,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();

View File

@@ -1384,6 +1384,9 @@ void NetworkOPsImp::processTrustedProposal (
bool relay = true;
if (mConsensus)
mConsensus->storeProposal (proposal, nodePublic);
if (!haveConsensusObject ())
{
m_journal.info << "Received proposal outside consensus window";
@@ -1393,8 +1396,6 @@ void NetworkOPsImp::processTrustedProposal (
}
else
{
mConsensus->storeProposal (proposal, nodePublic);
if (mLedgerConsensus->getLCL () == proposal->getPrevLedger ())
{
relay = mLedgerConsensus->peerPosition (proposal);