MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_reconnect_sender_add

Function test_reconnect_sender_add

tests/test_connection.py:781–809  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

779@pytest.mark.openchannel('v1')
780@pytest.mark.openchannel('v2')
781def test_reconnect_sender_add(node_factory):
782 disconnects = ['-WIRE_COMMITMENT_SIGNED',
783 '+WIRE_COMMITMENT_SIGNED',
784 '-WIRE_REVOKE_AND_ACK',
785 '+WIRE_REVOKE_AND_ACK']
786 if EXPERIMENTAL_DUAL_FUND:
787 disconnects = ['=WIRE_COMMITMENT_SIGNED'] + disconnects
788
789 # Feerates identical so we don't get gratuitous commit to update them
790 l1 = node_factory.get_node(disconnect=disconnects,
791 may_reconnect=True,
792 feerates=(7500, 7500, 7500, 7500))
793 l2 = node_factory.get_node(may_reconnect=True)
794 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
795
796 l1.fundchannel(l2, 10**6)
797
798 amt = 200000000
799 inv = l2.rpc.invoice(amt, 'testpayment', 'desc')
800 rhash = inv['payment_hash']
801 assert only_one(l2.rpc.listinvoices('testpayment')['invoices'])['status'] == 'unpaid'
802
803 route = [{'amount_msat': amt, 'id': l2.info['id'], 'delay': 5, 'channel': first_scid(l1, l2)}]
804
805 # This will send commit, so will reconnect as required.
806 l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret'])
807 # Should have printed this for every reconnect.
808 for i in range(0, len(disconnects)):
809 l1.daemon.wait_for_log('Already have funding locked in')
810
811
812@pytest.mark.developer

Callers

nothing calls this directly

Calls 9

only_oneFunction · 0.90
first_scidFunction · 0.90
sendpayMethod · 0.80
wait_for_logMethod · 0.80
get_nodeMethod · 0.45
connectMethod · 0.45
fundchannelMethod · 0.45
invoiceMethod · 0.45
listinvoicesMethod · 0.45

Tested by

no test coverage detected