Skip to content

Commit 22cd0e8

Browse files
committed
test: support WTX INVs from P2PDataStore and fix a comment
1 parent ebe42c0 commit 22cd0e8

File tree

1 file changed

+4
-3
lines changed
  • test/functional/test_framework

1 file changed

+4
-3
lines changed

test/functional/test_framework/p2p.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,13 @@ def __init__(self):
808808
self.getdata_requests = []
809809

810810
def on_getdata(self, message):
811-
"""Check for the tx/block in our stores and if found, reply with an inv message."""
811+
"""Check for the tx/block in our stores and if found, reply with MSG_TX or MSG_BLOCK."""
812812
for inv in message.inv:
813813
self.getdata_requests.append(inv.hash)
814-
if (inv.type & MSG_TYPE_MASK) == MSG_TX and inv.hash in self.tx_store.keys():
814+
invtype = inv.type & MSG_TYPE_MASK
815+
if (invtype == MSG_TX or invtype == MSG_WTX) and inv.hash in self.tx_store.keys():
815816
self.send_message(msg_tx(self.tx_store[inv.hash]))
816-
elif (inv.type & MSG_TYPE_MASK) == MSG_BLOCK and inv.hash in self.block_store.keys():
817+
elif invtype == MSG_BLOCK and inv.hash in self.block_store.keys():
817818
self.send_message(msg_block(self.block_store[inv.hash]))
818819
else:
819820
logger.debug('getdata message type {} received.'.format(hex(inv.type)))

0 commit comments

Comments
 (0)