Open
Description
If all our channels are too low to pay
an invoice, but the sum of the spendable on those channels should be high enough, we should rebalance on the next pay
attempt to consolidate our funds.
We need these:
- Suggestion: lower-level "paycode" below "invoice" level #2666 Suggestion: lower-level "paycode" below "invoice" level - to not interfere with our own incoming invoices being watched by
waitanyinvoice
. -
ensurepayable <channel> <amount_msat> <fee_budget_msat>
-> success/fail - Ensure that the specificchannel
has a spendable amount greater or equal toamount_msat
, spending at mostfee_budget_msat
to rebalance. This (and plugin: Implement thehtlc_accepted
hook #2267) can be used later by JIT-routing by @renepickhardt. -
selectconnectedchannel [<min_capacity_msat>] [<node>]
->{'channel': <channel>}
/fail - Select a well-connected local channel. Ifmin_capacity_msat
is specified, only select a channel whose capacity is at least the given capacity. Ifnode
is specified, prefer channels that are well-connected to this (possibly very remote) node. I think the "RouteBoost" code ininvoice
can work for the initial version of this; ignorenode
for now, but leave it as a future point for improvement later. - In the
pay
loop that creates the initialexcludes
, if all local channels get excluded, check if the total spendable is above the payment amount + fee budget. If so,selectconnectedchannel
to the destination node andensurepayable
the returned channel, with a fraction of our own fee budget.