diff options
| author | Matt Corallo <[email protected]> | 2017-03-08 14:41:57 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-03-17 14:55:43 -0700 |
| commit | d2548a4f9704b1f475b4068d2d1686cf3780f742 (patch) | |
| tree | 67be6d9e3dff4be3eeae890e37d1d38500af4dcb /src/net.cpp | |
| parent | Fix regsig checking for subkey sigs in verify-commits (diff) | |
| download | discoin-d2548a4f9704b1f475b4068d2d1686cf3780f742.tar.xz discoin-d2548a4f9704b1f475b4068d2d1686cf3780f742.zip | |
Fix shutdown hang with >= 8 -addnodes set
We previously would block waiting for a CSemaphoreGrant in
ThreadOpenAddedConnections, when we did not need to. This would
block as the posts in CConnman shutdown were both to the wrong
semaphore and in the wrong location.
Github-Pull: #9953
Rebased-From: e007b243c4840e44857b5ccf686ed35899e44af0
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp index de5fc2969..e35a89e74 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2321,6 +2321,10 @@ void CConnman::Interrupt() if (semOutbound) for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++) semOutbound->post(); + + if (semAddnode) + for (int i=0; i<nMaxAddnode; i++) + semAddnode->post(); } void CConnman::Stop() @@ -2336,10 +2340,6 @@ void CConnman::Stop() if (threadSocketHandler.joinable()) threadSocketHandler.join(); - if (semAddnode) - for (int i=0; i<nMaxAddnode; i++) - semOutbound->post(); - if (fAddressesInitialized) { DumpData(); |