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

Function test_gossip_store_private_channels

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

Source from the content-addressed store, hash-verified

1568
1569@pytest.mark.developer("need dev-compact-gossip-store")
1570def test_gossip_store_private_channels(node_factory, bitcoind):
1571 l1, l2 = node_factory.line_graph(2, announce_channels=False)
1572
1573 # We see this channel, even though it's not announced, because it's local.
1574 wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 2)
1575
1576 l2.stop()
1577 l1.restart()
1578
1579 # We should still see local channels!
1580 time.sleep(3) # Make sure store is loaded
1581 chans = l1.rpc.listchannels()['channels']
1582 assert len(chans) == 2
1583
1584 # Now compact store
1585 l1.rpc.call('dev-compact-gossip-store')
1586 l1.restart()
1587
1588 time.sleep(3) # Make sure store is loaded
1589 # We should still see local channels!
1590 chans = l1.rpc.listchannels()['channels']
1591 assert len(chans) == 2
1592
1593
1594def setup_gossip_store_test(node_factory, bitcoind):

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