From 0e20cfedb704c1f76bb727e2009867d3d503a03d Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Mon, 29 Jun 2020 14:59:55 -0400 Subject: [PATCH] Disconnect peers sending wtxidrelay message after VERACK --- src/net_processing.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 7822e9c0ad8..c6eeeabbccb 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2506,6 +2506,12 @@ void ProcessMessage( // Feature negotiation of wtxidrelay should happen between VERSION and // VERACK, to avoid relay problems from switching after a connection is up if (msg_type == NetMsgType::WTXIDRELAY) { + if (pfrom.fSuccessfullyConnected) { + // Disconnect peers that send wtxidrelay message after VERACK; this + // must be negotiated between VERSION and VERACK. + pfrom.fDisconnect = true; + return; + } if (pfrom.nVersion >= WTXID_RELAY_VERSION) { LOCK(cs_main); if (!State(pfrom.GetId())->m_wtxid_relay) {