From 7456a8880af58a050ed137d5076814ce23d782f6 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Thu, 24 Oct 2024 16:49:21 +0700 Subject: [PATCH] fix: do not show duplicated incoming funds from channel closures There is overlap in balance from pending closed channels and total onchain balance. They will show as incoming in the total onchain balance once the channel becomes sweepable. This PR also adds extra balance info that can be retrieved from debug tools -> get balances --- frontend/src/screens/channels/Channels.tsx | 12 +++++------- lnclient/ldk/ldk.go | 16 ++++++++++++++++ lnclient/lnd/lnd.go | 4 ++++ lnclient/models.go | 9 +++++---- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index b2457118..fdcde540 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -318,15 +318,11 @@ export default function Channels() { {new Intl.NumberFormat().format(balances.onchain.spendable)}{" "} sats {balances && - (balances.onchain.spendable !== balances.onchain.total || - balances.onchain.pendingBalancesFromChannelClosures > - 0) && ( + balances.onchain.spendable !== balances.onchain.total && (

+ {new Intl.NumberFormat().format( - balances.onchain.total - - balances.onchain.spendable + - balances.onchain.pendingBalancesFromChannelClosures + balances.onchain.total - balances.onchain.spendable )}{" "} sats incoming

@@ -435,7 +431,9 @@ export default function Channels() { balances.onchain.pendingBalancesFromChannelClosures )}{" "} sats pending from one or more closed channels. Once spendable again - these will become available in your savings balance.{" "} + these will become available in your savings balance. Funds from + channels that were force closed may take up to 2 weeks to become + available.{" "}