Skip to content

Commit 41dca08

Browse files
committed
[trivial] Extract connection type doc into file where it is used.
This slightly reduces the size of the binary.
1 parent 3069b56 commit 41dca08

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/net.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,12 @@ struct CSerializedNetMsg
116116
std::string m_type;
117117
};
118118

119-
const std::vector<std::string> CONNECTION_TYPE_DOC{
120-
"outbound-full-relay (default automatic connections)",
121-
"block-relay-only (does not relay transactions or addresses)",
122-
"inbound (initiated by the peer)",
123-
"manual (added via addnode RPC or -addnode/-connect configuration options)",
124-
"addr-fetch (short-lived automatic connection for soliciting addresses)",
125-
"feeler (short-lived automatic connection for testing addresses)"};
126-
127119
/** Different types of connections to a peer. This enum encapsulates the
128120
* information we have available at the time of opening or accepting the
129-
* connection. Aside from INBOUND, all types are initiated by us. */
121+
* connection. Aside from INBOUND, all types are initiated by us.
122+
*
123+
* If adding or removing types, please update CONNECTION_TYPE_DOC in
124+
* src/rpc/net.cpp. */
130125
enum class ConnectionType {
131126
/**
132127
* Inbound connections are those initiated by a peer. This is the only

src/rpc/net.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929

3030
#include <univalue.h>
3131

32+
const std::vector<std::string> CONNECTION_TYPE_DOC{
33+
"outbound-full-relay (default automatic connections)",
34+
"block-relay-only (does not relay transactions or addresses)",
35+
"inbound (initiated by the peer)",
36+
"manual (added via addnode RPC or -addnode/-connect configuration options)",
37+
"addr-fetch (short-lived automatic connection for soliciting addresses)",
38+
"feeler (short-lived automatic connection for testing addresses)"
39+
};
40+
3241
static RPCHelpMan getconnectioncount()
3342
{
3443
return RPCHelpMan{"getconnectioncount",

0 commit comments

Comments
 (0)