(node_factory)
| 790 | @pytest.mark.openchannel('v1') |
| 791 | @pytest.mark.openchannel('v2') |
| 792 | def test_reconnect_sender_add1(node_factory): |
| 793 | # Fail after add is OK, will cause payment failure though. |
| 794 | # Make sure it doesn't send commit before it sees disconnect though. |
| 795 | disconnects = ['-WIRE_UPDATE_ADD_HTLC', |
| 796 | '+WIRE_UPDATE_ADD_HTLC'] |
| 797 | |
| 798 | # Feerates identical so we don't get gratuitous commit to update them |
| 799 | l1 = node_factory.get_node(disconnect=disconnects, |
| 800 | may_reconnect=True, |
| 801 | options={'commit-time': 2000}, |
| 802 | feerates=(7500, 7500, 7500, 7500)) |
| 803 | l2 = node_factory.get_node(may_reconnect=True) |
| 804 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 805 | |
| 806 | l1.fundchannel(l2, 10**6) |
| 807 | |
| 808 | amt = 200000000 |
| 809 | inv = l2.rpc.invoice(amt, 'test_reconnect_sender_add1', 'desc') |
| 810 | rhash = inv['payment_hash'] |
| 811 | assert only_one(l2.rpc.listinvoices('test_reconnect_sender_add1')['invoices'])['status'] == 'unpaid' |
| 812 | |
| 813 | route = [{'amount_msat': amt, 'id': l2.info['id'], 'delay': 5, 'channel': first_scid(l1, l2)}] |
| 814 | |
| 815 | for i in range(0, len(disconnects)): |
| 816 | with pytest.raises(RpcError): |
| 817 | l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret']) |
| 818 | l1.rpc.waitsendpay(rhash) |
| 819 | |
| 820 | # Wait for reconnection. |
| 821 | l1.daemon.wait_for_log('Already have funding locked in') |
| 822 | |
| 823 | # This will send commit, so will reconnect as required. |
| 824 | l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret']) |
| 825 | |
| 826 | |
| 827 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected