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

Function test_restart_multi_htlc_rexmit

tests/test_connection.py:3272–3294  ·  view source on GitHub ↗
(node_factory, bitcoind, executor)

Source from the content-addressed store, hash-verified

3270
3271
3272def test_restart_multi_htlc_rexmit(node_factory, bitcoind, executor):
3273 # l1 disables commit timer once we send first htlc, dies on commit
3274 l1, l2 = node_factory.line_graph(2, opts=[{'disconnect': ['-WIRE_COMMITMENT_SIGNED'],
3275 'may_reconnect': True,
3276 'dev-disable-commit-after': 0},
3277 {'may_reconnect': True}])
3278
3279 executor.submit(l1.pay, l2, 20000)
3280 executor.submit(l1.pay, l2, 30000)
3281
3282 l1.daemon.wait_for_logs(['peer_out WIRE_UPDATE_ADD_HTLC'] * 2)
3283 l1.rpc.dev_reenable_commit(l2.info['id'])
3284 l1.daemon.wait_for_log('dev_disconnect: -WIRE_COMMITMENT_SIGNED')
3285
3286 # This will make it reconnect
3287 l1.stop()
3288 # Clear the disconnect so we can proceed normally
3289 l1.daemon.disconnect = None
3290 l1.start()
3291
3292 # Payments will fail due to restart, but we can see results in listsendpays.
3293 print(l1.rpc.listsendpays())
3294 wait_for(lambda: [p['status'] for p in l1.rpc.listsendpays()['payments']] == ['complete', 'complete'])
3295
3296
3297def test_fulfill_incoming_first(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 8

wait_forFunction · 0.90
line_graphMethod · 0.80
wait_for_logsMethod · 0.80
dev_reenable_commitMethod · 0.80
wait_for_logMethod · 0.80
listsendpaysMethod · 0.80
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected