Skip to content

Commit

Permalink
net: only delete CConnman if it's been created (#1555)
Browse files Browse the repository at this point in the history
In the case of (for example) an already-running bitcoind, the shutdown sequence
begins before CConnman has been created, leading to a null-pointer dereference
when g_connman->Stop() is called.

Instead, Just let the CConnman dtor take care of stopping.
  • Loading branch information
OlegGirko authored and UdjinM6 committed Jul 27, 2017
1 parent b621cfb commit cc4db34
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ void PrepareShutdown()
#endif
GenerateBitcoins(false, 0, Params(), *g_connman);
MapPort(false);
g_connman->Stop();
g_connman.reset();

// STORE DATA CACHES INTO SERIALIZED DAT FILES
Expand Down
1 change: 1 addition & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ void CConnman::DeleteNode(CNode* pnode)

CConnman::~CConnman()
{
Stop();
}

size_t CConnman::GetAddressCount() const
Expand Down

0 comments on commit cc4db34

Please sign in to comment.