Skip to content

Commit

Permalink
net: stop both net/net_processing before destroying them
Browse files Browse the repository at this point in the history
This should avoid either attempting to use an invalid reference/pointer to the
other.
  • Loading branch information
theuni authored and xanimo committed Feb 7, 2025
1 parent b97bfc8 commit cb5d402
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ void Shutdown()
pwalletMain->Flush(false);
#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)
Expand Down

0 comments on commit cb5d402

Please sign in to comment.