Expose integral m_conn_type in CNodeStats, remove m_conn_type_string

This commit is contained in:
Jon Atack
2021-01-02 10:44:03 +01:00
committed by MarcoFalke
parent 4b8b71e630
commit faecb74562
3 changed files with 8 additions and 7 deletions

View File

@@ -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; }