mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-12 16:17:53 +00:00
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.
This commit is contained in:
parent
6996e066b5
commit
e007b243c4
@ -2322,6 +2322,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()
|
||||
@ -2337,10 +2341,6 @@ void CConnman::Stop()
|
||||
if (threadSocketHandler.joinable())
|
||||
threadSocketHandler.join();
|
||||
|
||||
if (semAddnode)
|
||||
for (int i=0; i<nMaxAddnode; i++)
|
||||
semOutbound->post();
|
||||
|
||||
if (fAddressesInitialized)
|
||||
{
|
||||
DumpData();
|
||||
|
Loading…
Reference in New Issue
Block a user