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

Function test_channel_reenable

tests/test_connection.py:2436–2454  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

2434
2435
2436def test_channel_reenable(node_factory):
2437 l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True}, fundchannel=True, wait_for_announce=True)
2438
2439 l1.daemon.wait_for_log('Received node_announcement for node {}'.format(l2.info['id']))
2440 l2.daemon.wait_for_log('Received node_announcement for node {}'.format(l1.info['id']))
2441
2442 # Both directions should be active before the restart
2443 wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True])
2444
2445 # Restart l2, will cause l1 to reconnect
2446 l2.stop()
2447 wait_for(lambda: [c['peer_connected'] for c in l1.rpc.listpeerchannels()['channels']] == [False])
2448 l2.start()
2449
2450 # Updates may be suppressed if redundant; just test results.
2451 wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True])
2452 wait_for(lambda: [c['peer_connected'] for c in l1.rpc.listpeerchannels()['channels']] == [True])
2453 wait_for(lambda: [c['active'] for c in l2.rpc.listchannels()['channels']] == [True, True])
2454 wait_for(lambda: [c['peer_connected'] for c in l2.rpc.listpeerchannels()['channels']] == [True])
2455
2456
2457def test_update_fee(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 7

wait_forFunction · 0.90
line_graphMethod · 0.80
wait_for_logMethod · 0.80
listpeerchannelsMethod · 0.80
listchannelsMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected