mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
[refactor] Restructure logic to check for addr relay.
We previously identified if we relay addresses to the connection by checking for the existence of the m_addr_known data structure. With this commit, we answer this question based on the connection type. IsAddrRelayPeer() checked for the existence of the m_addr_known
This commit is contained in:
@@ -861,6 +861,12 @@ public:
|
||||
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 {
|
||||
switch(m_conn_type) {
|
||||
case ConnectionType::INBOUND:
|
||||
@@ -891,8 +897,6 @@ public:
|
||||
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
|
||||
std::chrono::microseconds 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 announce.
|
||||
// There is no final sorting before sending, as they are always sent immediately
|
||||
// and in the order requested.
|
||||
|
||||
Reference in New Issue
Block a user