diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2021-04-21 16:39:40 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2021-12-02 13:15:32 +0700 |
commit | b884ababc29ce963826d8a4327ed6a5e629ff175 (patch) | |
tree | 55b49ff02eec85ec0f133a236c997ede8224c43e /src/rpc/net.cpp | |
parent | df562d698a386166ef93d03326c0480ea9bc11fe (diff) | |
download | bitcoin-b884ababc29ce963826d8a4327ed6a5e629ff175.tar.xz |
rpc: move Ensure* helpers to server_util.h
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r-- | src/rpc/net.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index e33f1ce4a3..6765735780 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -8,7 +8,6 @@ #include <chainparams.h> #include <clientversion.h> #include <core_io.h> -#include <net.h> #include <net_permissions.h> #include <net_processing.h> #include <net_types.h> // For banmap_t @@ -17,12 +16,12 @@ #include <policy/settings.h> #include <rpc/blockchain.h> #include <rpc/protocol.h> +#include <rpc/server_util.h> #include <rpc/util.h> #include <sync.h> #include <timedata.h> #include <util/strencodings.h> #include <util/string.h> -#include <util/system.h> #include <util/translation.h> #include <validation.h> #include <version.h> @@ -41,22 +40,6 @@ const std::vector<std::string> CONNECTION_TYPE_DOC{ "feeler (short-lived automatic connection for testing addresses)" }; -CConnman& EnsureConnman(const NodeContext& node) -{ - if (!node.connman) { - throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); - } - return *node.connman; -} - -PeerManager& EnsurePeerman(const NodeContext& node) -{ - if (!node.peerman) { - throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); - } - return *node.peerman; -} - static RPCHelpMan getconnectioncount() { return RPCHelpMan{"getconnectioncount", |