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

Function test_gossip_store_local_channels

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

Source from the content-addressed store, hash-verified

1543
1544@pytest.mark.developer("need dev-compact-gossip-store")
1545def test_gossip_store_local_channels(node_factory, bitcoind):
1546 l1, l2 = node_factory.line_graph(2, wait_for_announce=False)
1547
1548 # We see this channel, even though it's not announced, because it's local.
1549 wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 2)
1550
1551 l2.stop()
1552 l1.restart()
1553
1554 # We should still see local channels!
1555 time.sleep(3) # Make sure store is loaded
1556 chans = l1.rpc.listchannels()['channels']
1557 assert len(chans) == 2
1558
1559 # Now compact store
1560 l1.rpc.call('dev-compact-gossip-store')
1561 l1.restart()
1562
1563 time.sleep(3) # Make sure store is loaded
1564 # We should still see local channels!
1565 chans = l1.rpc.listchannels()['channels']
1566 assert len(chans) == 2
1567
1568
1569@pytest.mark.developer("need dev-compact-gossip-store")

Callers

nothing calls this directly

Calls 6

wait_forFunction · 0.90
line_graphMethod · 0.80
restartMethod · 0.80
listchannelsMethod · 0.45
stopMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected