aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-03-28 10:44:53 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-03-29 11:45:46 -0400
commitfa369651c5523f393e0bfcfa328b8e27006711aa (patch)
treefb560aac582c7073afa51e95f9c375203cea3973 /src/net.h
parent210b533a114462473024c92a20a0765001abd45d (diff)
downloadbitcoin-fa369651c5523f393e0bfcfa328b8e27006711aa.tar.xz
net: Add missing cs_vNodes lock
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/net.h b/src/net.h
index 975d7f15d7..96ac33b536 100644
--- a/src/net.h
+++ b/src/net.h
@@ -188,16 +188,13 @@ public:
~CConnman();
bool Start(CScheduler& scheduler, const Options& options);
- // TODO: Remove NO_THREAD_SAFETY_ANALYSIS. Lock cs_vNodes before reading the variable vNodes.
- //
- // When removing NO_THREAD_SAFETY_ANALYSIS be aware of the following lock order requirements:
- // * CheckForStaleTipAndEvictPeers locks cs_main before indirectly calling GetExtraOutboundCount
- // which locks cs_vNodes.
- // * ProcessMessage locks cs_main and g_cs_orphans before indirectly calling ForEachNode which
- // locks cs_vNodes.
- //
- // Thus the implicit locking order requirement is: (1) cs_main, (2) g_cs_orphans, (3) cs_vNodes.
- void Stop() NO_THREAD_SAFETY_ANALYSIS;
+ void StopThreads();
+ void StopNodes();
+ void Stop()
+ {
+ StopThreads();
+ StopNodes();
+ };
void Interrupt();
bool GetNetworkActive() const { return fNetworkActive; };