(self)
| 28 | self.num_nodes = 1 |
| 29 | |
| 30 | def run_test(self): |
| 31 | p2p_block_store = self.nodes[0].add_p2p_connection(P2PStoreBlock()) |
| 32 | |
| 33 | self.log.info("test that an invalid GETDATA doesn't prevent processing of future messages") |
| 34 | |
| 35 | # Send invalid message and verify that node responds to later ping |
| 36 | invalid_getdata = msg_getdata() |
| 37 | invalid_getdata.inv.append(CInv(t=0, h=0)) # INV type 0 is invalid. |
| 38 | p2p_block_store.send_and_ping(invalid_getdata) |
| 39 | |
| 40 | # Check getdata still works by fetching tip block |
| 41 | best_block = int(self.nodes[0].getbestblockhash(), 16) |
| 42 | good_getdata = msg_getdata() |
| 43 | good_getdata.inv.append(CInv(t=2, h=best_block)) |
| 44 | p2p_block_store.send_and_ping(good_getdata) |
| 45 | p2p_block_store.wait_until(lambda: p2p_block_store.blocks[best_block] == 1) |
| 46 | |
| 47 | |
| 48 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected