mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
txorphanage: Add lock annotations
EraseOrphansFor was called both with and without g_cs_orphans held, correct that so that it's always called with it already held. LimitOrphanTxSize was always called with g_cs_orphans held, so add annotations and don't lock it a second time.
This commit is contained in:
parent
81dd57e5b1
commit
38a11c355a
3 changed files with 6 additions and 5 deletions
|
|
@ -1003,7 +1003,7 @@ void PeerManagerImpl::FinalizeNode(const CNode& node, bool& fUpdateConnectionTim
|
|||
for (const QueuedBlock& entry : state->vBlocksInFlight) {
|
||||
mapBlocksInFlight.erase(entry.hash);
|
||||
}
|
||||
EraseOrphansFor(nodeid);
|
||||
WITH_LOCK(g_cs_orphans, EraseOrphansFor(nodeid));
|
||||
m_txrequest.DisconnectedPeer(nodeid);
|
||||
nPreferredDownload -= state->fPreferredDownload;
|
||||
nPeersWithValidatedDownloads -= (state->nBlocksInFlightValidHeaders != 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue