diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-12-03 14:59:27 -0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-12-10 11:37:18 +0100 |
commit | 9e806887a8f9ef63431b28d7dfd0470aa663dd02 (patch) | |
tree | 2776a3f64923f086d881c4d8f6ab492d03b13423 | |
parent | aa4b8ebfecddc7795200904009fea84b2c644141 (diff) | |
download | bitcoin-9e806887a8f9ef63431b28d7dfd0470aa663dd02.tar.xz |
Don't send 'sendaddrv2' to pre-70016 software
Github-Pull: #20564
Rebased-From: c5a89196602e43ebb1cdc9cd4f08d153419c13e1
-rw-r--r-- | src/net_processing.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index c649cf7757..44f6f5d6b6 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2367,7 +2367,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); |