Browse Source

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: 2525b972af
tags/v0.15.1
Cory Fields 3 years ago
parent
commit
0a5477c7e3
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/init.cpp

+ 5
- 1
src/init.cpp View File

@@ -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)) {

Loading…
Cancel
Save