MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_gossmap_lost_node

Function test_gossmap_lost_node

tests/test_gossip.py:2561–2581  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

2559
2560
2561def test_gossmap_lost_node(node_factory, bitcoind):
2562 l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True)
2563
2564 scid23 = only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['short_channel_id']
2565 l2.rpc.close(l3.info['id'])
2566 bitcoind.generate_block(73, wait_for_mempool=1)
2567
2568 # Order of nodes is not stable.
2569 sync_blockheight(bitcoind, [l1])
2570 assert l1.rpc.listchannels(scid23) == {'channels': []}
2571
2572 pre_channels = l1.rpc.listchannels()
2573 # Make sure all node_announcements have been seen.
2574 wait_for(lambda: all(['alias' in n for n in l1.rpc.listnodes()['nodes']]))
2575 pre_nodes = sorted(l1.rpc.listnodes()['nodes'], key=lambda n: n['nodeid'])
2576 l1.restart()
2577 post_channels = l1.rpc.listchannels()
2578 post_nodes = sorted(l1.rpc.listnodes()['nodes'], key=lambda n: n['nodeid'])
2579
2580 assert post_channels == pre_channels
2581 assert post_nodes == pre_nodes
2582
2583
2584def test_gossip_dying_when_compact(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 10

only_oneFunction · 0.90
sync_blockheightFunction · 0.90
wait_forFunction · 0.90
line_graphMethod · 0.80
listpeerchannelsMethod · 0.80
generate_blockMethod · 0.80
restartMethod · 0.80
closeMethod · 0.45
listchannelsMethod · 0.45
listnodesMethod · 0.45

Tested by

no test coverage detected