From c9ffb72fb5d09ccfde6d24fa64b3f4243f2008db Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 16 Mar 2024 15:54:08 +0300 Subject: [PATCH] fix: avoid `hSocket` double lock It's is locked in `CloseSocketDisconnect()` already. --- src/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 4090ad4023b87..460b4d78275ee 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -4237,7 +4237,7 @@ void CConnman::UnregisterEvents(CNode *pnode) { #ifdef USE_KQUEUE if (socketEventsMode == SOCKETEVENTS_KQUEUE) { - LOCK(pnode->cs_hSocket); + AssertLockHeld(pnode->cs_hSocket); if (pnode->hSocket == INVALID_SOCKET) { return; } @@ -4255,7 +4255,7 @@ void CConnman::UnregisterEvents(CNode *pnode) #endif #ifdef USE_EPOLL if (socketEventsMode == SOCKETEVENTS_EPOLL) { - LOCK(pnode->cs_hSocket); + AssertLockHeld(pnode->cs_hSocket); if (pnode->hSocket == INVALID_SOCKET) { return; }