aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorSuhas Daftuar <[email protected]>2020-06-29 14:59:55 -0400
committerSuhas Daftuar <[email protected]>2020-07-19 02:10:42 -0400
commit0e20cfedb704c1f76bb727e2009867d3d503a03d (patch)
tree661ba75427210b2ff5367360bb53c07f15e9b5c3 /src/net_processing.cpp
parenttest: Use wtxid relay generally in functional tests (diff)
downloaddiscoin-0e20cfedb704c1f76bb727e2009867d3d503a03d.tar.xz
discoin-0e20cfedb704c1f76bb727e2009867d3d503a03d.zip
Disconnect peers sending wtxidrelay message after VERACK
Diffstat (limited to 'src/net_processing.cpp')
-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 7822e9c0a..c6eeeabbc 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) {