[net/refactor] Introduce an enum to distinguish type of connection

- extract inbound & outbound types
This commit is contained in:
Amiti Uttarwar
2020-05-06 18:09:24 -07:00
parent 3f1b7140e9
commit 26304b4100
6 changed files with 20 additions and 18 deletions

View File

@@ -113,6 +113,10 @@ struct CSerializedNetMsg
std::string m_type;
};
enum class ConnectionType {
INBOUND,
OUTBOUND,
};
class NetEventsInterface;
class CConnman
@@ -856,7 +860,7 @@ public:
std::set<uint256> orphan_work_set;
CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn = "", bool fInboundIn = false, bool block_relay_only = false);
CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn = "", ConnectionType conn_type_in = ConnectionType::OUTBOUND, bool block_relay_only = false);
~CNode();
CNode(const CNode&) = delete;
CNode& operator=(const CNode&) = delete;