|
|
@ -58,6 +58,10 @@ class BaseNode(NodeConnCB): |
|
|
|
message.block.calc_sha256() |
|
|
|
message.block.calc_sha256() |
|
|
|
self.block_receive_map[message.block.sha256] += 1 |
|
|
|
self.block_receive_map[message.block.sha256] += 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def on_inv(self, conn, message): |
|
|
|
|
|
|
|
"""Override the standard on_inv callback""" |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
def custom_function(): |
|
|
|
def custom_function(): |
|
|
|
"""Do some custom behaviour |
|
|
|
"""Do some custom behaviour |
|
|
|
|
|
|
|
|
|
|
@ -198,8 +202,8 @@ class ExampleTest(BitcoinTestFramework): |
|
|
|
|
|
|
|
|
|
|
|
self.log.info("Wait for node2 reach current tip. Test that it has propogated all the blocks to us") |
|
|
|
self.log.info("Wait for node2 reach current tip. Test that it has propogated all the blocks to us") |
|
|
|
|
|
|
|
|
|
|
|
for block in blocks: |
|
|
|
|
|
|
|
getdata_request = msg_getdata() |
|
|
|
getdata_request = msg_getdata() |
|
|
|
|
|
|
|
for block in blocks: |
|
|
|
getdata_request.inv.append(CInv(2, block)) |
|
|
|
getdata_request.inv.append(CInv(2, block)) |
|
|
|
node2.send_message(getdata_request) |
|
|
|
node2.send_message(getdata_request) |
|
|
|
|
|
|
|
|
|
|
|