diff --git a/doc/bips.md b/doc/bips.md --- a/doc/bips.md +++ b/doc/bips.md @@ -33,7 +33,7 @@ * [`BIP 145`](https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki): getblocktemplate updates for Segregated Witness as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)). BIP 145 has been removed in Bitcoin ABC. * [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)). BIP 147 has been removed in Bitcoin ABC. * [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)). -* [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): addrv2 message is available as of **v0.22.14** ([D9201](https://reviews.bitcoinabc.org/D9201)). +* [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): The 'addrv2' and 'sendaddrv2' messages which enable relay of Tor V3 addresses (and other networks) are supported as of **v0.22.14** ([D9201](https://reviews.bitcoinabc.org/D9201)). * [`BIP 157`](https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki): Client Side Block Filtering is available as of **v0.22.10** ([T589](https://reviews.bitcoinabc.org/T589)). * [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients is available as of **v0.19.6** ([T589](https://reviews.bitcoinabc.org/T589)). * [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): NODE_NETWORK_LIMITED service bit [signaling only] is supported as of **v0.18.7**. ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)). diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1859,6 +1859,10 @@ static void RelayAddress(const CAddress &addr, bool fReachable, const CConnman &connman) { + if (!fReachable && !addr.IsRelayable()) { + return; + } + // Relay to a limited number of other nodes. // Use deterministic randomness to send to the same nodes for 24 hours at a // time so the m_addr_knowns of the chosen nodes prevent repeats diff --git a/src/netaddress.h b/src/netaddress.h --- a/src/netaddress.h +++ b/src/netaddress.h @@ -234,6 +234,12 @@ } 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. */