Fix a case where a node that closed slightly ahead of other ledgers can

think it's out of sync with the network and cause it to jump backwards one
ledger, causing it to be out of sync because the network was about to catch
up to it.
This commit is contained in:
JoelKatz
2013-03-14 11:48:29 -07:00
parent 82b91a1c41
commit d4323f2ef2
5 changed files with 15 additions and 8 deletions

View File

@@ -373,9 +373,12 @@ void LedgerConsensus::checkLCL()
uint256 netLgr = mPrevLedgerHash;
int netLgrCount = 0;
uint256 favoredLedger = mPrevLedgerHash; // Don't get stuck one ledger back or jump one forward
uint256 favoredLedger = mPrevLedgerHash; // Don't jump forward
uint256 priorLedger;
if (mHaveCorrectLCL)
priorLedger = mPreviousLedger->getParentHash(); // don't jump back
boost::unordered_map<uint256, currentValidationCount> vals =
theApp->getValidations().getCurrentValidations(favoredLedger);
theApp->getValidations().getCurrentValidations(favoredLedger, priorLedger);
typedef std::map<uint256, currentValidationCount>::value_type u256_cvc_pair;
BOOST_FOREACH(u256_cvc_pair& it, vals)