test: Fix race in p2p_segwit

Co-Authored-By: Suhas Daftuar <sdaftuar@gmail.com>
This commit is contained in:
MarcoFalke 2020-02-28 03:25:49 +07:00
parent 1615043935
commit fa2cf85e6f
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -147,6 +147,11 @@ class TestP2PConn(P2PInterface):
super().__init__()
self.getdataset = set()
# Avoid sending out msg_getdata in the mininode thread as a reply to invs.
# They are not needed and would only lead to races because we send msg_getdata out in the test thread
def on_inv(self, message):
pass
def on_getdata(self, message):
for inv in message.inv:
self.getdataset.add(inv.hash)