aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-09-28 16:58:31 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2020-10-09 16:09:51 -0700
commit41dca087b73a3627107603694f5a982ea2a53189 (patch)
tree64136b2fd6d6c209b1d06d9ae5f5f93c5dca75fb /src
parent3069b56a456d98fca7c4a4ccd329581bd1f0b853 (diff)
[trivial] Extract connection type doc into file where it is used.
This slightly reduces the size of the binary.
Diffstat (limited to 'src')
-rw-r--r--src/net.h13
-rw-r--r--src/rpc/net.cpp9
2 files changed, 13 insertions, 9 deletions
diff --git a/src/net.h b/src/net.h
index 1051511f54..ee2469b8cb 100644
--- a/src/net.h
+++ b/src/net.h
@@ -116,17 +116,12 @@ struct CSerializedNetMsg
std::string m_type;
};
-const std::vector<std::string> CONNECTION_TYPE_DOC{
- "outbound-full-relay (default automatic connections)",
- "block-relay-only (does not relay transactions or addresses)",
- "inbound (initiated by the peer)",
- "manual (added via addnode RPC or -addnode/-connect configuration options)",
- "addr-fetch (short-lived automatic connection for soliciting addresses)",
- "feeler (short-lived automatic connection for testing addresses)"};
-
/** Different types of connections to a peer. This enum encapsulates the
* information we have available at the time of opening or accepting the
- * connection. Aside from INBOUND, all types are initiated by us. */
+ * connection. Aside from INBOUND, all types are initiated by us.
+ *
+ * If adding or removing types, please update CONNECTION_TYPE_DOC in
+ * src/rpc/net.cpp. */
enum class ConnectionType {
/**
* Inbound connections are those initiated by a peer. This is the only
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 431199d4f6..9b725b786d 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -29,6 +29,15 @@
#include <univalue.h>
+const std::vector<std::string> CONNECTION_TYPE_DOC{
+ "outbound-full-relay (default automatic connections)",
+ "block-relay-only (does not relay transactions or addresses)",
+ "inbound (initiated by the peer)",
+ "manual (added via addnode RPC or -addnode/-connect configuration options)",
+ "addr-fetch (short-lived automatic connection for soliciting addresses)",
+ "feeler (short-lived automatic connection for testing addresses)"
+};
+
static RPCHelpMan getconnectioncount()
{
return RPCHelpMan{"getconnectioncount",