Stash and apply proposals received with a different LCL.

This commit is contained in:
JoelKatz
2012-08-30 12:28:02 -07:00
parent faaedb806f
commit 4d3fc5b6a5
4 changed files with 29 additions and 5 deletions

View File

@@ -813,7 +813,12 @@ void LedgerConsensus::Saccept(boost::shared_ptr<LedgerConsensus> This, SHAMap::p
void LedgerConsensus::deferProposal(const LedgerProposal::pointer& proposal, const NewcoinAddress& peerPublic)
{
/**/
if (!peerPublic.isValid())
return;
std::list<LedgerProposal::pointer>& props = mDeferredProposals[peerPublic.getNodeID()];
if (props.size() > (mPreviousProposers + 10))
props.pop_front();
props.push_back(proposal);
}
void LedgerConsensus::playbackProposals()
@@ -821,7 +826,15 @@ void LedgerConsensus::playbackProposals()
for ( boost::unordered_map< uint160, std::list<LedgerProposal::pointer> >::iterator
it = mDeferredProposals.begin(), end = mDeferredProposals.end(); it != end; ++it)
{
/**/
BOOST_FOREACH(const LedgerProposal::pointer& proposal, it->second)
{
proposal->setPrevLedger(mPrevLedgerHash);
if (proposal->checkSign())
{
Log(lsINFO) << "Applying deferred proposal";
peerPosition(proposal);
}
}
}
}