aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-01-02 10:44:03 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-07 15:18:44 +0100
commitfaecb74562d012a336837d3b39572c235ad2eb9d (patch)
tree9921c0a213a77cff964a02d084b2ca67513fee7c /src/net.h
parent4b8b71e630415647c75fa95d5407690b372bceff (diff)
downloadbitcoin-faecb74562d012a336837d3b39572c235ad2eb9d.tar.xz
Expose integral m_conn_type in CNodeStats, remove m_conn_type_string
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index acc1da49a5..83fdb7f3e5 100644
--- a/src/net.h
+++ b/src/net.h
@@ -180,6 +180,8 @@ enum class ConnectionType {
ADDR_FETCH,
};
+/** Convert ConnectionType enum to a string value */
+std::string ConnectionTypeAsString(ConnectionType conn_type);
void Discover();
void StartMapPort();
void InterruptMapPort();
@@ -273,11 +275,10 @@ public:
// Network the peer connected through
Network m_network;
uint32_t m_mapped_as;
- std::string m_conn_type_string;
+ ConnectionType m_conn_type;
};
-
/** Transport protocol agnostic message container.
* Ideally it should only contain receive time, payload,
* command and size.
@@ -765,7 +766,7 @@ public:
//! Sets the addrName only if it was not previously set
void MaybeSetAddrName(const std::string& addrNameIn);
- std::string ConnectionTypeAsString() const;
+ std::string ConnectionTypeAsString() const { return ::ConnectionTypeAsString(m_conn_type); }
/** Whether this peer is an inbound onion, e.g. connected via our Tor onion service. */
bool IsInboundOnion() const { return m_inbound_onion; }