Skip to content

Conversation

@f321x
Copy link
Member

@f321x f321x commented Oct 20, 2025

On master it's currently not possible to do self payments (e.g. rebalance) as additional checks in save_payment_info introduced in a7afd59 prevent LNWallet.pay_invoice() to overwrite an existing PaymentInfo as they differ more than in status (e.g. direction).
I think PaymentInfo should be stored separately by direction instead of storing PaymentInfo of both directions in db['lightning_payments'] so it is more explicit what "kind" of PaymentInfo is being handled and allow for a receiving and sending PaymentInfo with the same rhash. Right now this seems prone to bugs (esp with a self-payment where we use the PaymentInfo to handle incoming htlcs but also change its status on the sending side, so two unrelated functions modify the same value).

This conflicts with #10230 so I'll shelf this until #10230 is finished.

@f321x f321x changed the title lighting: fix self payments (e.g. rebalance) lightning: fix self payments (e.g. rebalance) Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant