|
|
@ -2182,16 +2182,18 @@ void CConnman::SetNetworkActive(bool active) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint(BCLog::NET, "SetNetworkActive: %s\n", active); |
|
|
|
LogPrint(BCLog::NET, "SetNetworkActive: %s\n", active); |
|
|
|
|
|
|
|
|
|
|
|
if (!active) { |
|
|
|
if (fNetworkActive == active) { |
|
|
|
fNetworkActive = false; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fNetworkActive = active; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!fNetworkActive) { |
|
|
|
LOCK(cs_vNodes); |
|
|
|
LOCK(cs_vNodes); |
|
|
|
// Close sockets to all nodes
|
|
|
|
// Close sockets to all nodes
|
|
|
|
for (CNode* pnode : vNodes) { |
|
|
|
for (CNode* pnode : vNodes) { |
|
|
|
pnode->CloseSocketDisconnect(); |
|
|
|
pnode->CloseSocketDisconnect(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
fNetworkActive = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uiInterface.NotifyNetworkActiveChanged(fNetworkActive); |
|
|
|
uiInterface.NotifyNetworkActiveChanged(fNetworkActive); |
|
|
|