(self)
| 26 | # We'll connect the nodes later |
| 27 | |
| 28 | def run_test(self): |
| 29 | self.generate(self.nodes[0], 3, sync_fun=self.no_op) |
| 30 | datadir = get_datadir_path(self.options.tmpdir, 0) |
| 31 | |
| 32 | # Deleting the undo file will result in reorg failure |
| 33 | os.unlink(os.path.join(datadir, self.chain, 'blocks', 'rev00000.dat')) |
| 34 | |
| 35 | # Connecting to a node with a more work chain will trigger a reorg |
| 36 | # attempt. |
| 37 | self.generate(self.nodes[1], 3, sync_fun=self.no_op) |
| 38 | with self.nodes[0].assert_debug_log(["Failed to disconnect block"]): |
| 39 | self.connect_nodes(0, 1) |
| 40 | self.generate(self.nodes[1], 1, sync_fun=self.no_op) |
| 41 | |
| 42 | # Check that node0 aborted |
| 43 | self.log.info("Waiting for crash") |
| 44 | self.nodes[0].wait_until_stopped(timeout=200) |
| 45 | self.log.info("Node crashed - now verifying restart fails") |
| 46 | self.nodes[0].assert_start_raises_init_error() |
| 47 | |
| 48 | |
| 49 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected