aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-12-03 14:59:27 -0800
committerPieter Wuille <pieter@wuille.net>2020-12-07 09:13:57 -0800
commitc5a89196602e43ebb1cdc9cd4f08d153419c13e1 (patch)
tree44dd6d98cc93ca25a56f27a461012008ef66d823 /src/net_processing.cpp
parent5c4911e7e7523fb7643da209254bbc2ef7898d2e (diff)
Don't send 'sendaddrv2' to pre-70016 software
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 1b4a05f0b6..667c5fa5a3 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2365,7 +2365,13 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::VERACK));
// Signal ADDRv2 support (BIP155).
- m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDADDRV2));
+ if (greatest_common_version >= 70016) {
+ // BIP155 defines addrv2 and sendaddrv2 for all protocol versions, but some
+ // implementations reject messages they don't know. As a courtesy, don't send
+ // it to nodes with a version before 70016, as no software is known to support
+ // BIP155 that doesn't announce at least that protocol version number.
+ m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDADDRV2));
+ }
pfrom.nServices = nServices;
pfrom.SetAddrLocal(addrMe);