Revert "Invoke DisconnectNodes from getconnectioncount/getpeerinfo/getnetworkinfo"

This reverts commit 2f1b3a34ab.
This commit is contained in:
Alexander Block 2020-04-21 18:23:57 +02:00
parent ccb1f84b3a
commit 98ff8feaf2
2 changed files with 1 additions and 8 deletions

View File

@ -457,7 +457,6 @@ public:
void WakeMessageHandler(); void WakeMessageHandler();
void WakeSelect(); void WakeSelect();
void DisconnectNodes();
/** Attempts to obfuscate tx time through exponentially distributed emitting. /** Attempts to obfuscate tx time through exponentially distributed emitting.
Works assuming that a single interval is used. Works assuming that a single interval is used.
@ -482,6 +481,7 @@ private:
void ThreadOpenConnections(std::vector<std::string> connect); void ThreadOpenConnections(std::vector<std::string> connect);
void ThreadMessageHandler(); void ThreadMessageHandler();
void AcceptConnection(const ListenSocket& hListenSocket); void AcceptConnection(const ListenSocket& hListenSocket);
void DisconnectNodes();
void NotifyNumConnectionsChanged(); void NotifyNumConnectionsChanged();
void InactivityCheck(CNode *pnode); void InactivityCheck(CNode *pnode);
bool GenerateSelectSet(std::set<SOCKET> &recv_set, std::set<SOCKET> &send_set, std::set<SOCKET> &error_set); bool GenerateSelectSet(std::set<SOCKET> &recv_set, std::set<SOCKET> &send_set, std::set<SOCKET> &error_set);

View File

@ -40,7 +40,6 @@ UniValue getconnectioncount(const JSONRPCRequest& request)
if(!g_connman) if(!g_connman)
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
g_connman->DisconnectNodes();
return (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL); return (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL);
} }
@ -127,8 +126,6 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
if(!g_connman) if(!g_connman)
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
g_connman->DisconnectNodes();
std::vector<CNodeStats> vstats; std::vector<CNodeStats> vstats;
g_connman->GetNodeStats(vstats); g_connman->GetNodeStats(vstats);
@ -470,10 +467,6 @@ UniValue getnetworkinfo(const JSONRPCRequest& request)
+ HelpExampleRpc("getnetworkinfo", "") + HelpExampleRpc("getnetworkinfo", "")
); );
if (g_connman) {
g_connman->DisconnectNodes();
}
LOCK(cs_main); LOCK(cs_main);
UniValue obj(UniValue::VOBJ); UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("version", CLIENT_VERSION)); obj.push_back(Pair("version", CLIENT_VERSION));