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