Test a bug where the htlc timeout would kick in even if the HTLC failed
(node_factory)
| 3867 | |
| 3868 | |
| 3869 | def test_htlc_failed_noclose(node_factory): |
| 3870 | """Test a bug where the htlc timeout would kick in even if the HTLC failed""" |
| 3871 | l1, l2 = node_factory.line_graph(2) |
| 3872 | |
| 3873 | inv = l2.rpc.invoice(1000, "test", "test") |
| 3874 | routestep = { |
| 3875 | 'amount_msat': FUNDAMOUNT * 1000, |
| 3876 | 'id': l2.info['id'], |
| 3877 | 'delay': 5, |
| 3878 | 'channel': first_scid(l1, l2) |
| 3879 | } |
| 3880 | |
| 3881 | # This fails at channeld |
| 3882 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 3883 | with pytest.raises(RpcError, match="Capacity exceeded"): |
| 3884 | l1.rpc.waitsendpay(inv['payment_hash']) |
| 3885 | |
| 3886 | # Send a second one, too: make sure we don't crash. |
| 3887 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 3888 | with pytest.raises(RpcError, match="Capacity exceeded"): |
| 3889 | l1.rpc.waitsendpay(inv['payment_hash']) |
| 3890 | |
| 3891 | time.sleep(35) |
| 3892 | assert l1.rpc.getpeer(l2.info['id'])['connected'] |
| 3893 | |
| 3894 | |
| 3895 | @pytest.mark.openchannel('v2') |
nothing calls this directly
no test coverage detected