Test a bug where the htlc timeout would kick in even if the HTLC failed
(node_factory)
| 3813 | |
| 3814 | |
| 3815 | def test_htlc_failed_noclose(node_factory): |
| 3816 | """Test a bug where the htlc timeout would kick in even if the HTLC failed""" |
| 3817 | l1, l2 = node_factory.line_graph(2) |
| 3818 | |
| 3819 | inv = l2.rpc.invoice(1000, "test", "test") |
| 3820 | routestep = { |
| 3821 | 'amount_msat': FUNDAMOUNT * 1000, |
| 3822 | 'id': l2.info['id'], |
| 3823 | 'delay': 5, |
| 3824 | 'channel': first_scid(l1, l2) |
| 3825 | } |
| 3826 | |
| 3827 | # This fails at channeld |
| 3828 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 3829 | with pytest.raises(RpcError, match="Capacity exceeded"): |
| 3830 | l1.rpc.waitsendpay(inv['payment_hash']) |
| 3831 | |
| 3832 | # Send a second one, too: make sure we don't crash. |
| 3833 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 3834 | with pytest.raises(RpcError, match="Capacity exceeded"): |
| 3835 | l1.rpc.waitsendpay(inv['payment_hash']) |
| 3836 | |
| 3837 | time.sleep(35) |
| 3838 | assert l1.rpc.getpeer(l2.info['id'])['connected'] |
| 3839 | |
| 3840 | |
| 3841 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected