1

From what I understand, in the current Lightning implementations payments work as follows:

  1. calculate best N paths according to some metric (like, total fees);
  2. try to perform the payment through the best path;
  3. if it fails, try the next one, until one succeeds.

Is there a way, using standard APIs and implementations, to specify the path for the payment explicitly? For example, how can I find the best 10 paths and then try to execute the payment through path number 4?

1

In clightning there exist the sendpay command. From the manpage:

sendpay route payment_hash [label] [msatoshi] [bolt11]
  Send along {route} in return for preimage of {payment_hash}

If you look at my (work in progress) code for JIT routing you can see how I create paths and onions myself just with standard api calls to rebalance my channels :

https://github.com/renepickhardt/c-lightning-plugin-collection/blob/master/rebalance-jit-routing/rebalance.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.