mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make our ledger a bit stickier to avoid the "check at the wrong time"
problem (when you don't have enough validations for the latest ledger and so jump backwards when you shouldn't. This solves every known ledger consensus issue except the "stuck one ledger behind" issue. I'm working on that now.
This commit is contained in:
@@ -446,18 +446,18 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector<Peer::pointer>& peerLis
|
||||
// node is using. THis is kind of fundamental.
|
||||
Log(lsTRACE) << "NetworkOPs::checkLastClosedLedger";
|
||||
|
||||
boost::unordered_map<uint256, ValidationCount> ledgers;
|
||||
Ledger::pointer ourClosed = mLedgerMaster->getClosedLedger();
|
||||
uint256 closedLedger = ourClosed->getHash();
|
||||
uint256 prevClosedLedger = ourClosed->getParentHash();
|
||||
|
||||
boost::unordered_map<uint256, ValidationCount> ledgers;
|
||||
{
|
||||
boost::unordered_map<uint256, int> current = theApp->getValidations().getCurrentValidations();
|
||||
boost::unordered_map<uint256, int> current = theApp->getValidations().getCurrentValidations(closedLedger);
|
||||
typedef std::pair<const uint256, int> u256_int_pair;
|
||||
BOOST_FOREACH(u256_int_pair& it, current)
|
||||
ledgers[it.first].trustedValidations += it.second;
|
||||
}
|
||||
|
||||
Ledger::pointer ourClosed = mLedgerMaster->getClosedLedger();
|
||||
uint256 closedLedger = ourClosed->getHash();
|
||||
uint256 prevClosedLedger = ourClosed->getParentHash();
|
||||
ValidationCount& ourVC = ledgers[closedLedger];
|
||||
|
||||
if ((theConfig.LEDGER_CREATOR) && (mMode >= omTRACKING))
|
||||
|
||||
Reference in New Issue
Block a user