Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | static UniValue getaddednodeinfo(const Config &config, | ||||
if (!g_connman) { | if (!g_connman) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_CLIENT_P2P_DISABLED, | RPC_CLIENT_P2P_DISABLED, | ||||
"Error: Peer-to-peer functionality missing or disabled"); | "Error: Peer-to-peer functionality missing or disabled"); | ||||
} | } | ||||
std::vector<AddedNodeInfo> vInfo = g_connman->GetAddedNodeInfo(); | std::vector<AddedNodeInfo> vInfo = g_connman->GetAddedNodeInfo(); | ||||
if (request.params.size() == 1) { | if (request.params.size() == 1 && !request.params[0].isNull()) { | ||||
bool found = false; | bool found = false; | ||||
for (const AddedNodeInfo &info : vInfo) { | for (const AddedNodeInfo &info : vInfo) { | ||||
if (info.strAddedNode == request.params[0].get_str()) { | if (info.strAddedNode == request.params[0].get_str()) { | ||||
vInfo.assign(1, info); | vInfo.assign(1, info); | ||||
found = true; | found = true; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 404 Lines • Show Last 20 Lines |