Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 1,035 Lines • ▼ Show 20 Lines | bool ExpectServicesFromConn() const { | ||||
case ConnectionType::BLOCK_RELAY: | case ConnectionType::BLOCK_RELAY: | ||||
case ConnectionType::ADDR_FETCH: | case ConnectionType::ADDR_FETCH: | ||||
return true; | return true; | ||||
} // no default case, so the compiler can warn about missing cases | } // no default case, so the compiler can warn about missing cases | ||||
assert(false); | assert(false); | ||||
} | } | ||||
/** | |||||
* Get network the peer connected through. | |||||
* | |||||
* Returns Network::NET_ONION for *inbound* onion connections, | |||||
* and CNetAddr::GetNetClass() otherwise. The latter cannot be used directly | |||||
* because it doesn't detect the former, and it's not the responsibility of | |||||
* the CNetAddr class to know the actual network a peer is connected | |||||
* through. | |||||
* | |||||
* @return network the peer connected through. | |||||
*/ | |||||
Network ConnectedThroughNetwork() const; | |||||
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 350 Lines • Show Last 20 Lines |