mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
We have to track the high node ID of trusted validators as a tie-breaker.
1) Change return from getCurrentValidations 2) Log tiebreaker logic to aid debugging 3) Change checkLastClosedLedger to use the new tie-breaker logic 4) Log when we refuse to switch to our own previous ledger 5) Track node ID in the serialized validation object 6) Simplify getCurrentValidations ledger suppression logic
This commit is contained in:
@@ -259,15 +259,15 @@ void LedgerConsensus::checkLCL()
|
||||
int netLgrCount = 0;
|
||||
|
||||
uint256 favoredLedger = (mState == lcsPRE_CLOSE) ? uint256() : mPrevLedgerHash; // Don't get stuck one ledger behind
|
||||
boost::unordered_map<uint256, int> vals =
|
||||
theApp->getValidations().getCurrentValidations(favoredLedger);
|
||||
boost::unordered_map<uint256, currentValidationCount> vals =
|
||||
theApp->getValidations().getCurrentValidations(favoredLedger);
|
||||
|
||||
typedef std::pair<const uint256, int> u256_int_pair;
|
||||
BOOST_FOREACH(u256_int_pair& it, vals)
|
||||
if (it.second > netLgrCount)
|
||||
typedef std::pair<const uint256, currentValidationCount> u256_cvc_pair;
|
||||
BOOST_FOREACH(u256_cvc_pair& it, vals)
|
||||
if (it.second.first > netLgrCount)
|
||||
{
|
||||
netLgr = it.first;
|
||||
netLgrCount = it.second;
|
||||
netLgrCount = it.second.first;
|
||||
}
|
||||
|
||||
if (netLgr != mPrevLedgerHash)
|
||||
@@ -287,8 +287,8 @@ void LedgerConsensus::checkLCL()
|
||||
Log(lsWARNING) << mPrevLedgerHash << " to " << netLgr;
|
||||
|
||||
#ifdef DEBUG
|
||||
BOOST_FOREACH(u256_int_pair& it, vals)
|
||||
Log(lsDEBUG) << "V: " << it.first << ", " << it.second;
|
||||
BOOST_FOREACH(u256_cvc_pair& it, vals)
|
||||
Log(lsDEBUG) << "V: " << it.first << ", " << it.second.first;
|
||||
#endif
|
||||
|
||||
if (mHaveCorrectLCL)
|
||||
|
||||
Reference in New Issue
Block a user