Exit out of TLSManager::waitFor() loop if shutdown requested

This commit is contained in:
Duke
2024-09-17 11:29:24 -04:00
parent 49f303d804
commit bd967b7ac6
2 changed files with 7 additions and 0 deletions

View File

@@ -10,6 +10,8 @@
#include "tlsmanager.h"
#include "utiltls.h"
extern bool ShutdownRequested();
using namespace std;
// store our preferred cipherlist so we can use it for debug/etc later on
std::string TLS_CIPHERLIST;
@@ -85,6 +87,10 @@ int TLSManager::waitFor(SSLConnectionRoutine eRoutine, SOCKET hSocket, WOLFSSL*
while (true)
{
if(ShutdownRequested()) {
LogPrintf("%s: shutdown requested, exiting\n", __func__);
return retOp;
}
// clear the current thread's error queue
wolfSSL_ERR_clear_error();

View File

@@ -2927,6 +2927,7 @@ void SetNetworkActive(bool active)
if (!fNetworkActive) {
LOCK(cs_vNodes);
// Close sockets to all nodes
LogPrint("net", "%s: closing sockets to all nodes\n", __func__);
for (CNode* pnode : vNodes) {
pnode->CloseSocketDisconnect();
}