I know it is possible with LND and I don't know if it is possible with Eclair. I have tried to issue an invoice and to find a route with the same node but I got the { "code" : -1, "message" : "Could not find a route" } message.

What am I missing?


Natively c-lightning does not support paying invoices to yourself. But I have provided a trick described in this video: https://www.youtube.com/watch?v=Dwl-0cY6KkU&t=1s:

The trick is to create an invoice and then use getroute to find a route to some node and then go back (possible over another route with another getroute call). once you have such a circle the sendpay command. While getroute does not find a route to yourself the sendpay does not care as long as the onions are great an the payment hash exists.

This trick can be used to do spontaneous payments (as described in my video) or to rebalance your channels. The full code for spontaneous payments can be found on my github lightning helpers repo. The python code would have to be adapted a little bit to your needes but that should be fairly straight forward. Ping me if you need help.

On a side note. I balance my channels be decreasing my routing fees because then people will do it for me and I still earn something instead of me paying fees for rebalancing.

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.