Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 916 Lines • ▼ Show 20 Lines | public: | ||||
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; | ||||
} | } | ||||
/* Whether we send addr messages over this connection */ | |||||
bool RelayAddrsWithConn() const { | |||||
return m_conn_type != ConnectionType::BLOCK_RELAY; | |||||
} | |||||
bool ExpectServicesFromConn() const { | bool ExpectServicesFromConn() const { | ||||
switch (m_conn_type) { | switch (m_conn_type) { | ||||
case ConnectionType::INBOUND: | case ConnectionType::INBOUND: | ||||
case ConnectionType::MANUAL: | case ConnectionType::MANUAL: | ||||
case ConnectionType::FEELER: | case ConnectionType::FEELER: | ||||
return false; | return false; | ||||
case ConnectionType::OUTBOUND_FULL_RELAY: | case ConnectionType::OUTBOUND_FULL_RELAY: | ||||
case ConnectionType::BLOCK_RELAY: | case ConnectionType::BLOCK_RELAY: | ||||
Show All 15 Lines | public: | ||||
// flood relay | // flood relay | ||||
std::vector<CAddress> vAddrToSend; | std::vector<CAddress> vAddrToSend; | ||||
std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr; | std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr; | ||||
bool fGetAddr{false}; | bool fGetAddr{false}; | ||||
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0}; | std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0}; | ||||
std::chrono::microseconds | std::chrono::microseconds | ||||
m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0}; | m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0}; | ||||
bool IsAddrRelayPeer() const { return m_addr_known != nullptr; } | |||||
// List of block ids we still have to announce. | // List of block ids we still have to announce. | ||||
// There is no final sorting before sending, as they are always sent | // There is no final sorting before sending, as they are always sent | ||||
// immediately and in the order requested. | // immediately and in the order requested. | ||||
std::vector<BlockHash> vInventoryBlockToSend GUARDED_BY(cs_inventory); | std::vector<BlockHash> vInventoryBlockToSend GUARDED_BY(cs_inventory); | ||||
Mutex cs_inventory; | Mutex cs_inventory; | ||||
struct TxRelay { | struct TxRelay { | ||||
mutable RecursiveMutex cs_filter; | mutable RecursiveMutex cs_filter; | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |