Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 874 Lines • ▼ Show 20 Lines | public: | ||||
bool fSentAddr{false}; | bool fSentAddr{false}; | ||||
CSemaphoreGrant grantOutbound; | CSemaphoreGrant grantOutbound; | ||||
std::atomic<int> nRefCount{0}; | std::atomic<int> nRefCount{0}; | ||||
const uint64_t nKeyedNetGroup; | const uint64_t nKeyedNetGroup; | ||||
std::atomic_bool fPauseRecv{false}; | std::atomic_bool fPauseRecv{false}; | ||||
std::atomic_bool fPauseSend{false}; | std::atomic_bool fPauseSend{false}; | ||||
bool IsFullOutboundConn() const { | |||||
return m_conn_type == ConnectionType::OUTBOUND; | |||||
} | |||||
bool IsManualConn() const { return m_conn_type == ConnectionType::MANUAL; } | bool IsManualConn() const { return m_conn_type == ConnectionType::MANUAL; } | ||||
bool IsBlockOnlyConn() const { | |||||
return m_conn_type == ConnectionType::BLOCK_RELAY; | |||||
} | |||||
bool IsFeelerConn() const { return m_conn_type == ConnectionType::FEELER; } | bool IsFeelerConn() const { return m_conn_type == ConnectionType::FEELER; } | ||||
bool IsAddrFetchConn() const { | bool IsAddrFetchConn() const { | ||||
return m_conn_type == ConnectionType::ADDR_FETCH; | return m_conn_type == ConnectionType::ADDR_FETCH; | ||||
} | } | ||||
bool IsInboundConn() const { | bool IsInboundConn() const { | ||||
return m_conn_type == ConnectionType::INBOUND; | return m_conn_type == ConnectionType::INBOUND; | ||||
} | } | ||||
bool ExpectServicesFromConn() const { | |||||
switch (m_conn_type) { | |||||
case ConnectionType::INBOUND: | |||||
case ConnectionType::MANUAL: | |||||
case ConnectionType::FEELER: | |||||
return false; | |||||
case ConnectionType::OUTBOUND: | |||||
case ConnectionType::BLOCK_RELAY: | |||||
case ConnectionType::ADDR_FETCH: | |||||
return true; | |||||
} | |||||
assert(false); | |||||
} | |||||
protected: | protected: | ||||
mapMsgCmdSize mapSendBytesPerMsgCmd; | mapMsgCmdSize mapSendBytesPerMsgCmd; | ||||
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv); | mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv); | ||||
public: | public: | ||||
BlockHash hashContinue; | BlockHash hashContinue; | ||||
std::atomic<int> nStartingHeight{-1}; | std::atomic<int> nStartingHeight{-1}; | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |