diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index bdba1c7da4..802810f681 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -247,10 +247,7 @@ void LedgerConsensus::checkLCL() uint256 netLgr = mPrevLedgerHash; int netLgrCount = 0; - uint256 favorLedger; - if (mState != lcsPRE_CLOSE) - favorLedger = mPrevLedgerHash; - boost::unordered_map vals = theApp->getValidations().getCurrentValidations(favorLedger); + boost::unordered_map vals = theApp->getValidations().getCurrentValidations(mPrevLedgerHash); typedef std::pair u256_int_pair; BOOST_FOREACH(u256_int_pair& it, vals) diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 7706cd7ac9..754559db83 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -446,18 +446,18 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector& peerLis // node is using. THis is kind of fundamental. Log(lsTRACE) << "NetworkOPs::checkLastClosedLedger"; - boost::unordered_map ledgers; + Ledger::pointer ourClosed = mLedgerMaster->getClosedLedger(); + uint256 closedLedger = ourClosed->getHash(); + uint256 prevClosedLedger = ourClosed->getParentHash(); + boost::unordered_map ledgers; { - boost::unordered_map current = theApp->getValidations().getCurrentValidations(); + boost::unordered_map current = theApp->getValidations().getCurrentValidations(closedLedger); typedef std::pair 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))