I think for "heavy objects" (non integral), we use extern const in the header and put them in the c++ file. This might reduce the size of the binary minimally.
So if you need to touch this code in the future again, you could apply the following diff (or similar):
diff --git a/src/net.cpp b/src/net.cpp
index 5b533d7d17..166fc8233d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -488,6 +488,15 @@ void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNet
}
}
+extern 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)",
+};
+
std::string CNode::ConnectionTypeAsString() const
{
switch (m_conn_type) {
diff --git a/src/net.h b/src/net.h
index 5a8e57b68b..3c6c45c161 100644
--- a/src/net.h
+++ b/src/net.h
@@ -114,13 +114,7 @@ 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)"};
+extern const std::vector<std::string> CONNECTION_TYPE_DOC;
/** Different types of connections to a peer. This enum encapsulates the
* information we have available at the time of opening or accepting the