aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2020-06-29 14:59:55 -0400
committerJohn Newbery <john@johnnewbery.com>2020-09-24 13:24:10 +0100
commitf082a13ab756a378b260711a30d363f833a2306a (patch)
treea1119cebc4f42e5afbca7b89e499704b1a51a77a
parent22effa51a77a8b8c72ba3525cb08dd0cf8464715 (diff)
Disconnect peers sending wtxidrelay message after VERACK
-rw-r--r--src/net_processing.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 853c488bed..43447a2c34 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2213,6 +2213,12 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
// 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 false;
+ }
if (pfrom->nVersion >= WTXID_RELAY_VERSION) {
LOCK(cs_main);
if (!State(pfrom->GetId())->m_wtxid_relay) {