aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-10-11 00:13:10 -0700
committerPieter Wuille <pieter@wuille.net>2020-10-11 11:29:11 -0700
commit56f9dba015c592b8925795012e3061a710070a27 (patch)
tree008f2313c14b9a87d9a82ef3bc4df45e593faf0c /src/netaddress.h
parent79f3d9b932bf62b90995bce1cf4b0b1f0152d26d (diff)
Only relay IPv4, IPv6, Tor addresses
Diffstat (limited to 'src/netaddress.h')
-rw-r--r--src/netaddress.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/netaddress.h b/src/netaddress.h
index 3bcf6d35ca..023e83e73d 100644
--- a/src/netaddress.h
+++ b/src/netaddress.h
@@ -212,6 +212,14 @@ class CNetAddr
friend bool operator<(const CNetAddr& a, const CNetAddr& b);
/**
+ * Whether this address should be relayed to other peers even if we can't reach it ourselves.
+ */
+ bool IsRelayable() const
+ {
+ return IsIPv4() || IsIPv6() || IsTor();
+ }
+
+ /**
* Serialize to a stream.
*/
template <typename Stream>