| 1622 | |
| 1623 | |
| 1624 | def test_gossip_store_corrupt(node_factory, bitcoind): |
| 1625 | l2 = setup_gossip_store_test(node_factory, bitcoind, opts=[{}, {'broken_log': 'gossip_store: Moving to gossip_store.corrupt'}, {}]) |
| 1626 | |
| 1627 | l2.stop() |
| 1628 | # It should truncate this, not leave junk! |
| 1629 | with open(os.path.join(l2.daemon.lightning_dir, TEST_NETWORK, 'gossip_store'), 'wb') as f: |
| 1630 | f.write(bytearray.fromhex("07deadbeef")) |
| 1631 | l2.start() |
| 1632 | |
| 1633 | # Complains, moves. |
| 1634 | wait_for(lambda: l2.daemon.is_in_log('gossipd: Cannot upgrade gossip_store version 7')) |
| 1635 | assert os.path.exists(os.path.join(l2.daemon.lightning_dir, TEST_NETWORK, 'gossip_store.corrupt')) |
| 1636 | |
| 1637 | |
| 1638 | def test_gossip_store_load_complex(node_factory, bitcoind): |