Skip to content

Commit faa76d1

Browse files
author
MarcoFalke
committed
qa: Fix inv race in example_test
1 parent 2507fd5 commit faa76d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/functional/example_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def on_block(self, conn, message):
5858
message.block.calc_sha256()
5959
self.block_receive_map[message.block.sha256] += 1
6060

61+
def on_inv(self, conn, message):
62+
"""Override the standard on_inv callback"""
63+
pass
64+
6165
def custom_function():
6266
"""Do some custom behaviour
6367
@@ -198,10 +202,10 @@ def run_test(self):
198202

199203
self.log.info("Wait for node2 reach current tip. Test that it has propogated all the blocks to us")
200204

205+
getdata_request = msg_getdata()
201206
for block in blocks:
202-
getdata_request = msg_getdata()
203207
getdata_request.inv.append(CInv(2, block))
204-
node2.send_message(getdata_request)
208+
node2.send_message(getdata_request)
205209

206210
# wait_until() will loop until a predicate condition is met. Use it to test properties of the
207211
# NodeConnCB objects.

0 commit comments

Comments
 (0)