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

Function send_many_payments

tests/test_connection.py:3921–3934  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3919 'channel': scid23}]
3920
3921 def send_many_payments():
3922 passes = 0
3923 fails = 0
3924 # Make sure we try many times, and get at least one pass and fail.
3925 while passes == 0 or fails == 0 or passes + fails < 30:
3926 inv = l3.rpc.invoice(100, "label-" + str(passes + fails), "desc")
3927 l1.rpc.sendpay(route, inv['payment_hash'], payment_secret=inv['payment_secret'])
3928 time.sleep(0.05)
3929 try:
3930 l1.rpc.waitsendpay(inv['payment_hash'])
3931 passes += 1
3932 except RpcError:
3933 fails += 1
3934 pass
3935
3936 # Send a heap of payments, while reconnecting...
3937 fut = executor.submit(send_many_payments)

Callers

nothing calls this directly

Calls 4

sendpayMethod · 0.80
waitsendpayMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected