[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.
This commit is contained in:
MarcoFalke
2018-09-15 20:01:20 -04:00
parent 2b88f67e0b
commit fa78a2fc67
4 changed files with 109 additions and 1 deletions

View File

@@ -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"