Skip to content

Commit c5a8919

Browse files
committed
Don't send 'sendaddrv2' to pre-70016 software
1 parent 5c4911e commit c5a8919

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/net_processing.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,13 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
23652365
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::VERACK));
23662366

23672367
// Signal ADDRv2 support (BIP155).
2368-
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDADDRV2));
2368+
if (greatest_common_version >= 70016) {
2369+
// BIP155 defines addrv2 and sendaddrv2 for all protocol versions, but some
2370+
// implementations reject messages they don't know. As a courtesy, don't send
2371+
// it to nodes with a version before 70016, as no software is known to support
2372+
// BIP155 that doesn't announce at least that protocol version number.
2373+
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDADDRV2));
2374+
}
23692375

23702376
pfrom.nServices = nServices;
23712377
pfrom.SetAddrLocal(addrMe);

0 commit comments

Comments
 (0)