diff options
| author | Matt Corallo <[email protected]> | 2017-02-02 13:51:57 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-02-02 13:51:57 -0500 |
| commit | 885cfdd2179a2aae733d0690f5a2ef23d181768e (patch) | |
| tree | e7ccb13171258fa0d9736c27dd713836fb17e8b9 /src/net.cpp | |
| parent | Merge #9654: Add jtimon pgp keys for commit sigs and future gitian builds (diff) | |
| download | discoin-885cfdd2179a2aae733d0690f5a2ef23d181768e.tar.xz discoin-885cfdd2179a2aae733d0690f5a2ef23d181768e.zip | |
Fix super-unlikely race introduced in 236618061a445d2cb11e72
Once the CNode has been added to vNodes, it is possible that it is
disconnected+deleted in the socket handler thread. However, after
that we now call InitializeNode, which accesses the pnode.
helgrind managed to tickle this case (somehow), but I suspect it
requires in immensely braindead scheduler.
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index df88b12c7..35d3348ad 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1833,11 +1833,11 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai if (fAddnode) pnode->fAddnode = true; + GetNodeSignals().InitializeNode(pnode, *this); { LOCK(cs_vNodes); vNodes.push_back(pnode); } - GetNodeSignals().InitializeNode(pnode, *this); return true; } |