mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 07:55:51 +00:00
mRecentPositions must be protected by the master lock.
This commit is contained in:
@@ -520,7 +520,7 @@ public:
|
||||
&getApp().getInboundLedgers(),
|
||||
mPrevLedgerHash, 0, InboundLedger::fcCONSENSUS));
|
||||
mHaveCorrectLCL = false;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -851,15 +851,16 @@ private:
|
||||
*/
|
||||
void accept (SHAMap::pointer set)
|
||||
{
|
||||
if (set->getHash ().isNonZero ())
|
||||
// put our set where others can get it later
|
||||
getApp().getOPs ().takePosition (mPreviousLedger
|
||||
->getLedgerSeq (), set);
|
||||
|
||||
{
|
||||
Application::ScopedLockType lock
|
||||
(getApp ().getMasterLock ());
|
||||
|
||||
// put our set where others can get it later
|
||||
if (set->getHash ().isNonZero ())
|
||||
getApp().getOPs ().takePosition (
|
||||
mPreviousLedger->getLedgerSeq (), set);
|
||||
|
||||
assert (set->getHash () == mOurPosition->getCurrentHash ());
|
||||
// these are now obsolete
|
||||
getApp().getOPs ().peekStoredProposals ().clear ();
|
||||
|
||||
@@ -1561,6 +1561,7 @@ void NetworkOPsImp::processTrustedProposal (LedgerProposal::pointer proposal,
|
||||
}
|
||||
}
|
||||
|
||||
// Must be called while holding the master lock
|
||||
SHAMap::pointer NetworkOPsImp::getTXMap (uint256 const& hash)
|
||||
{
|
||||
std::map<uint256, std::pair<int, SHAMap::pointer> >::iterator it = mRecentPositions.find (hash);
|
||||
@@ -1574,6 +1575,7 @@ SHAMap::pointer NetworkOPsImp::getTXMap (uint256 const& hash)
|
||||
return mConsensus->getTransactionTree (hash, false);
|
||||
}
|
||||
|
||||
// Must be called while holding the master lock
|
||||
void NetworkOPsImp::takePosition (int seq, SHAMap::ref position)
|
||||
{
|
||||
mRecentPositions[position->getHash ()] = std::make_pair (seq, position);
|
||||
|
||||
Reference in New Issue
Block a user