aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorAnthony Towns <[email protected]>2020-04-06 19:09:05 +1000
committerSuhas Daftuar <[email protected]>2020-07-19 02:05:42 -0400
commit2d282e0cba9761574b6b43d134ca95f3052d7fd2 (patch)
tree7372513b1bba00e6f0499e85b63c21a537d316c2 /src/net_processing.cpp
parentAdd support for tx-relay via wtxid (diff)
downloaddiscoin-2d282e0cba9761574b6b43d134ca95f3052d7fd2.tar.xz
discoin-2d282e0cba9761574b6b43d134ca95f3052d7fd2.zip
ignore non-wtxidrelay compliant invs
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 55c67ed18..f3b34957b 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2598,6 +2598,13 @@ void ProcessMessage(
if (interruptMsgProc)
return;
+ // ignore INVs that don't match wtxidrelay setting
+ if (State(pfrom.GetId())->m_wtxid_relay) {
+ if (inv.type == MSG_TX) continue;
+ } else {
+ if (inv.type == MSG_WTX) continue;
+ }
+
bool fAlreadyHave = AlreadyHave(inv, mempool);
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());