mirror of
https://github.com/monero-project/monero.git
synced 2026-06-12 19:11:36 -07:00
Merge pull request #10493
a46154e p2p: cleaner connection close() (j-berman)
This commit is contained in:
@@ -1142,7 +1142,9 @@ namespace net_utils
|
||||
bool connection<T>::close(const bool wait_for_shutdown)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(m_state.lock);
|
||||
if (m_state.status != status_t::RUNNING)
|
||||
if (m_state.status == status_t::TERMINATED || m_state.status == status_t::WASTED)
|
||||
return true;
|
||||
if (!wait_for_shutdown && m_state.status != status_t::RUNNING)
|
||||
return false;
|
||||
terminate_async();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user