From d3698b5ee309cf0f0cdfb286d6b30a256d7deae5 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Thu, 30 Apr 2020 11:21:33 -0700 Subject: [PATCH] [net/refactor] Add connection type as a member var to CNode - Directly maintaining the connection type prevents having to deduce it from several flags. --- src/net.cpp | 1 + src/net.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/net.cpp b/src/net.cpp index a43d02bbd90..42748dfc864 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2749,6 +2749,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn // traffic). id(idIn), nLocalHostNonce(nLocalHostNonceIn), + m_conn_type(conn_type_in), nLocalServices(nLocalServicesIn), nMyStartingHeight(nMyStartingHeightIn) { diff --git a/src/net.h b/src/net.h index 6a4ef6ab4ba..115effdef94 100644 --- a/src/net.h +++ b/src/net.h @@ -875,6 +875,7 @@ public: private: const NodeId id; const uint64_t nLocalHostNonce; + const ConnectionType m_conn_type; //! Services offered to this peer. //!