Skip to content

Commit

Permalink
test: support WTX INVs from P2PDataStore and fix a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vasild committed Oct 22, 2024
1 parent ebe42c0 commit 22cd0e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/functional/test_framework/p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,13 @@ def __init__(self):
self.getdata_requests = []

def on_getdata(self, message):
"""Check for the tx/block in our stores and if found, reply with an inv message."""
"""Check for the tx/block in our stores and if found, reply with MSG_TX or MSG_BLOCK."""
for inv in message.inv:
self.getdata_requests.append(inv.hash)
if (inv.type & MSG_TYPE_MASK) == MSG_TX and inv.hash in self.tx_store.keys():
invtype = inv.type & MSG_TYPE_MASK
if (invtype == MSG_TX or invtype == MSG_WTX) and inv.hash in self.tx_store.keys():
self.send_message(msg_tx(self.tx_store[inv.hash]))
elif (inv.type & MSG_TYPE_MASK) == MSG_BLOCK and inv.hash in self.block_store.keys():
elif invtype == MSG_BLOCK and inv.hash in self.block_store.keys():
self.send_message(msg_block(self.block_store[inv.hash]))
else:
logger.debug('getdata message type {} received.'.format(hex(inv.type)))
Expand Down

0 comments on commit 22cd0e8

Please sign in to comment.