aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-09-07 14:26:20 -0400
committerCory Fields <cory-nospam-@coryfields.com>2017-09-07 14:26:23 -0400
commit2525b972af6645ca239ac1078cffb132b402bfbb (patch)
tree40e39b0d9258c870f3c32e18ce708a484da9b6c3 /src
parent80e2e9d0cec890c5d2f81360ebb81e81c07ccb8c (diff)
downloadbitcoin-2525b972af6645ca239ac1078cffb132b402bfbb.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.
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 9e8029971f..810368b9d7 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -194,9 +194,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)) {