Skip to content

Commit d3698b5

Browse files
committed
[net/refactor] Add connection type as a member var to CNode
- Directly maintaining the connection type prevents having to deduce it from several flags.
1 parent 46578c0 commit d3698b5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,6 +2749,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
27492749
// traffic).
27502750
id(idIn),
27512751
nLocalHostNonce(nLocalHostNonceIn),
2752+
m_conn_type(conn_type_in),
27522753
nLocalServices(nLocalServicesIn),
27532754
nMyStartingHeight(nMyStartingHeightIn)
27542755
{

src/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ class CNode
875875
private:
876876
const NodeId id;
877877
const uint64_t nLocalHostNonce;
878+
const ConnectionType m_conn_type;
878879

879880
//! Services offered to this peer.
880881
//!

0 commit comments

Comments
 (0)