aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-09-15 20:01:20 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-10-26 07:45:12 -0400
commitfa78a2fc670d7162d6ba6d432188da6d6e5288ac (patch)
treed4c9af1ec508c0b20bbb1a3ab3957a9d6916a67c /test/functional/test_framework/messages.py
parent2b88f67e0bccbc23f30bf65f944f5cadad88f221 (diff)
downloadbitcoin-fa78a2fc670d7162d6ba6d432188da6d6e5288ac.tar.xz
[tests] Test that nodes respond to getdata with notfound
If a node has not announced a tx at all, then it should respond to getdata messages for that tx with notfound, to avoid leaking tx origination privacy.
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rwxr-xr-xtest/functional/test_framework/messages.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index 8e9372767d..92acbb9a09 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -1232,6 +1232,23 @@ class msg_mempool:
return "msg_mempool()"
+class msg_notfound:
+ __slots__ = ("vec", )
+ command = b"notfound"
+
+ def __init__(self, vec=None):
+ self.vec = vec or []
+
+ def deserialize(self, f):
+ self.vec = deser_vector(f, CInv)
+
+ def serialize(self):
+ return ser_vector(self.vec)
+
+ def __repr__(self):
+ return "msg_notfound(vec=%s)" % (repr(self.vec))
+
+
class msg_sendheaders:
__slots__ = ()
command = b"sendheaders"