aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2019-10-16 17:37:19 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2021-03-04 19:54:17 +0000
commitc77de622dd8ef458f73b1a01a34629a7c4f49358 (patch)
treeda0910c8472e5ab4820c16be3609b8b8bccd1a35 /src/rpc
parentb4d22654fe9e90093e643cb7beb896c48a274d47 (diff)
downloadbitcoin-c77de622dd8ef458f73b1a01a34629a7c4f49358.tar.xz
net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/mining.cpp2
-rw-r--r--src/rpc/net.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 50987a735b..f29f556517 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -659,7 +659,7 @@ static RPCHelpMan getblocktemplate()
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
if (!Params().IsTestChain()) {
- if (node.connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) {
+ if (node.connman->GetNodeCount(ConnectionDirection::Both) == 0) {
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!");
}
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 6d33654c6f..cf4d46cf2c 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -57,7 +57,7 @@ static RPCHelpMan getconnectioncount()
if(!node.connman)
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
- return (int)node.connman->GetNodeCount(CConnman::CONNECTIONS_ALL);
+ return (int)node.connman->GetNodeCount(ConnectionDirection::Both);
},
};
}
@@ -630,9 +630,9 @@ static RPCHelpMan getnetworkinfo()
obj.pushKV("timeoffset", GetTimeOffset());
if (node.connman) {
obj.pushKV("networkactive", node.connman->GetNetworkActive());
- obj.pushKV("connections", (int)node.connman->GetNodeCount(CConnman::CONNECTIONS_ALL));
- obj.pushKV("connections_in", (int)node.connman->GetNodeCount(CConnman::CONNECTIONS_IN));
- obj.pushKV("connections_out", (int)node.connman->GetNodeCount(CConnman::CONNECTIONS_OUT));
+ obj.pushKV("connections", (int)node.connman->GetNodeCount(ConnectionDirection::Both));
+ obj.pushKV("connections_in", (int)node.connman->GetNodeCount(ConnectionDirection::In));
+ obj.pushKV("connections_out", (int)node.connman->GetNodeCount(ConnectionDirection::Out));
}
obj.pushKV("networks", GetNetworksInfo());
obj.pushKV("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()));