aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-09-07 14:26:20 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-11-02 13:16:57 -0400
commit0a5477c7e30667f4dc864b69975a8da5f63ca71e (patch)
tree4b6dd3118c9f798babfaf5966da897e121c4e95d
parentb4136f21cfbbeb043ce46ffa1bf5f353838bfbea (diff)
downloadbitcoin-0a5477c7e30667f4dc864b69975a8da5f63ca71e.tar.xz
net: stop both net/net_processing before destroying them
This should avoid either attempting to use an invalid reference/pointer to the other. Github-Pull: #10756 Rebased-From: 2525b972af6645ca239ac1078cffb132b402bfbb
-rw-r--r--src/init.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 62250664e3..798c24a2a8 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -193,9 +193,13 @@ void Shutdown()
}
#endif
MapPort(false);
+
+ // Because these depend on each-other, we make sure that neither can be
+ // using the other before destroying them.
UnregisterValidationInterface(peerLogic.get());
- g_connman.reset();
+ g_connman->Stop();
peerLogic.reset();
+ g_connman.reset();
StopTorControl();
if (fDumpMempoolLater && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {