Can I explicitly specify a path for Lightning payment?

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?

Sergei Tikhomirov

Posted 2019-06-05T16:13:08.067

Reputation: 1 189

Answers

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

Rene Pickhardt

Posted 2019-06-05T16:13:08.067

Reputation: 6 565