Skip to content

Commit

Permalink
Don't send 'sendaddrv2' to pre-70016 software
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#20564
Rebased-From: c5a8919
  • Loading branch information
sipa authored and MarcoFalke committed Dec 10, 2020
1 parent aa4b8eb commit 9e80688
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9e80688

Please sign in to comment.