From e9b32843a5989026b6ee49b525c965577d0ab17d Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Thu, 22 May 2025 17:02:22 -0500 Subject: [PATCH] Make MTP server shutdown flag atomic I noticed this potential data race while reading the code. I have not detected it with TSan in practice. --- src/network/mtp/impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/mtp/impl.h b/src/network/mtp/impl.h index 3f81fe27b..b8059f202 100644 --- a/src/network/mtp/impl.h +++ b/src/network/mtp/impl.h @@ -12,6 +12,7 @@ #include "util/numeric.h" #include "porting.h" #include "network/networkprotocol.h" +#include #include #include #include @@ -301,7 +302,7 @@ private: // Backwards compatibility PeerHandler *m_bc_peerhandler; - bool m_shutting_down = false; + std::atomic m_shutting_down = false; }; } // namespace