(node_factory)
| 889 | |
| 890 | |
| 891 | def test_reconnect_receiver_fulfill(node_factory): |
| 892 | # Ordering matters: after +WIRE_UPDATE_FULFILL_HTLC, channeld |
| 893 | # will continue and try to send WIRE_COMMITMENT_SIGNED: if |
| 894 | # that's the next failure, it will do two in one run. |
| 895 | disconnects = ['+WIRE_UPDATE_FULFILL_HTLC', |
| 896 | '-WIRE_UPDATE_FULFILL_HTLC', |
| 897 | '-WIRE_COMMITMENT_SIGNED', |
| 898 | '+WIRE_COMMITMENT_SIGNED', |
| 899 | '-WIRE_REVOKE_AND_ACK', |
| 900 | '+WIRE_REVOKE_AND_ACK'] |
| 901 | l1 = node_factory.get_node(may_reconnect=True) |
| 902 | l2 = node_factory.get_node(disconnect=disconnects, |
| 903 | may_reconnect=True) |
| 904 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 905 | |
| 906 | l1.fundchannel(l2, 10**6) |
| 907 | |
| 908 | amt = 200000000 |
| 909 | inv = l2.rpc.invoice(amt, 'testpayment2', 'desc') |
| 910 | rhash = inv['payment_hash'] |
| 911 | assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['status'] == 'unpaid' |
| 912 | |
| 913 | route = [{'amount_msat': amt, 'id': l2.info['id'], 'delay': 5, 'channel': first_scid(l1, l2)}] |
| 914 | l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret']) |
| 915 | for i in range(len(disconnects)): |
| 916 | l1.daemon.wait_for_log('Already have funding locked in') |
| 917 | assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['status'] == 'paid' |
| 918 | |
| 919 | |
| 920 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected