aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-02-01 01:35:08 +1000
committerAnthony Towns <aj@erisian.com.au>2021-02-26 23:55:10 +1000
commit38a11c355acfc15134c682571b3d92f66b0e7c3c (patch)
tree05fb4cb6b122f806b6a5a9cd81c75f4989b32f9d /src/net_processing.cpp
parent81dd57e5b1ab1afa7e59468e30ef41bd34f0c8d7 (diff)
downloadbitcoin-38a11c355acfc15134c682571b3d92f66b0e7c3c.tar.xz
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.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index d842dca95b..01effa9245 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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);