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

Function test_htlc_retransmit_order

tests/test_connection.py:3542–3573  ·  view source on GitHub ↗
(node_factory, executor)

Source from the content-addressed store, hash-verified

3540
3541@pytest.mark.developer("needs --dev-disconnect")
3542def test_htlc_retransmit_order(node_factory, executor):
3543 NUM_HTLCS = 10
3544 l1, l2 = node_factory.line_graph(2,
3545 opts=[{'may_reconnect': True,
3546 'feerates': (7500, 7500, 7500, 7500),
3547 'disconnect': ['=WIRE_UPDATE_ADD_HTLC*' + str(NUM_HTLCS),
3548 '-WIRE_COMMITMENT_SIGNED'],
3549 'dev-disable-commit-after': 0},
3550 {'may_reconnect': True}])
3551 invoices = [l2.rpc.invoice(1000, str(x), str(x)) for x in range(NUM_HTLCS)]
3552
3553 routestep = {
3554 'amount_msat': 1000,
3555 'id': l2.info['id'],
3556 'delay': 5,
3557 'channel': first_scid(l1, l2)
3558 }
3559 for inv in invoices:
3560 executor.submit(l1.rpc.sendpay, [routestep], inv['payment_hash'], payment_secret=inv['payment_secret'])
3561
3562 l1.daemon.wait_for_log('dev_disconnect')
3563 l1.rpc.call('dev-reenable-commit', [l2.info['id']])
3564 l1.daemon.wait_for_log('dev_disconnect')
3565
3566 # Now reconnect.
3567 l1.rpc.connect(l2.info['id'], 'localhost', port=l2.port)
3568
3569 for inv in invoices:
3570 result = l1.rpc.waitsendpay(inv['payment_hash'])
3571 assert(result['status'] == 'complete')
3572
3573 # If order was wrong, we'll get a LOG_BROKEN and fixtures will complain.
3574
3575
3576@unittest.skipIf(True, "Currently failing, see tracking issue #4265")

Callers

nothing calls this directly

Calls 7

first_scidFunction · 0.90
line_graphMethod · 0.80
wait_for_logMethod · 0.80
waitsendpayMethod · 0.80
invoiceMethod · 0.45
callMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected