Include an `outbound_payment` flag in `MaybeTimeoutClaimableHTLC` (ChannelMonitor)
Host: dunxen -
- In PR 2476 the
AvailableBalances::balance_msatfield, which caused confusion due to its strange computation, was removed in favour of using
ChannelMonitor::get_claimable_balanceswhich is more straightforward for most use-cases and indicates balances claimable by the holder after taking on-chain fees into account.
- In PR 2333 the
Balance::claimable_amount_satoshismethod was added, which excluded balances that we are unsure can be claimed (i.e. returns
0for those balances). This makes sense on the surface, however, in the case of forwarding an HTLC, we know that we would either be able to claim the timeout balance from downstream or the preimage balance from upstream. Neither of these would be included in this calculation while the forwarded payment was still pending and not timed out.
- PR 2618 (this PR) will include the timeout balance (
MaybeTimeoutClaimableHTLC) but only in the case of forwarded payments. This offers a more accurate view of the claimable balance.
- Did you review the PR? Concept ACK, approach ACK, tested ACK, or NACK?
- How was the value of the (now removed)
AvailableBalances::balance_msatfield calculated and what was its intended usage?
- What do we use instead of
balance_msatfor the above purpose?
- Without the use of
balance_msathow might a developer using LDK calculate an appropriate balance to show to an end-user?
- What should the
HTLCSourceof an outbound payment be? And for a forwarded payment?
- What other fluctuations in balance do we still have after this PR for forwarded payments? How might we resolve these in a future PR?