mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Do the tryLocal/addPeers operations on an InboundLedger without the collection lock.
This commit is contained in:
@@ -48,22 +48,7 @@ InboundLedger::pointer InboundLedgers::findCreate (uint256 const& hash, uint32 s
|
||||
ret = boost::make_shared<InboundLedger> (hash, seq);
|
||||
assert (ret);
|
||||
mLedgers.insert (std::make_pair (hash, ret));
|
||||
|
||||
if (!ret->tryLocal())
|
||||
{
|
||||
ret->addPeers ();
|
||||
ret->setTimer (); // Cannot call in constructor
|
||||
}
|
||||
else if (!ret->isFailed ())
|
||||
{
|
||||
WriteLog (lsDEBUG, InboundLedger) << "Acquiring ledger we already have locally: " << hash;
|
||||
Ledger::pointer ledger = ret->getLedger ();
|
||||
ledger->setClosed ();
|
||||
ledger->setImmutable ();
|
||||
getApp().getLedgerMaster ().storeLedger (ledger);
|
||||
if (couldBeNew)
|
||||
getApp().getLedgerMaster().checkAccept(ledger);
|
||||
}
|
||||
ret->init (sl, couldBeNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user