aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-08-10 14:48:54 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2020-09-02 17:18:21 -0700
commitdff16b184b1428a068d144e5e4dde7595b4729c0 (patch)
treed177683017907e7edc7183c31131f0c7bb030c9c /src/net.h
parenta6ab1e81f964df131cfa0e11e07bedb3283b823f (diff)
downloadbitcoin-dff16b184b1428a068d144e5e4dde7595b4729c0.tar.xz
[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
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 81c960cc9c..a4830d09e9 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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.