diff options
author | Jon Atack <jon@atack.com> | 2021-01-02 10:44:03 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-07 15:18:44 +0100 |
commit | faecb74562d012a336837d3b39572c235ad2eb9d (patch) | |
tree | 9921c0a213a77cff964a02d084b2ca67513fee7c /src/net.h | |
parent | 4b8b71e630415647c75fa95d5407690b372bceff (diff) | |
download | bitcoin-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.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |