From cca6e20c0123bb1e23c182f032603c933c1a1674 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Mon, 5 Aug 2024 13:15:09 +0700 Subject: [PATCH] fix: channel warnings - do not show forwarding fee error if channel is opening - remove alert for low spending capacity --- .env.example | 5 ++++- frontend/src/screens/channels/Channels.tsx | 18 ------------------ lnclient/ldk/ldk.go | 7 +++++-- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.env.example b/.env.example index a4239df8..07454f9d 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ # only enable event logging in production LOG_EVENTS=false +# do not link your current account when you run a dev instance (so it stays pointing at your mainnet one) +AUTO_LINK_ALBY_ACCOUNT=false + #WORK_DIR=.data #DATABASE_URI=nwc.db #NOSTR_PRIVKEY= @@ -9,7 +12,7 @@ LOG_EVENTS=false #RELAY=ws://localhost:7447/v1 #PORT=8080 #FRONTEND_URL=http://localhost:5173 -#AUTO_LINK_ALBY_ACCOUNT=false + # Alby OAuth configuration #ALBY_OAUTH_CLIENT_SECRET= diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index 4b180b19..bc7476a1 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -409,24 +409,6 @@ export default function Channels() { )} - - {/* If all channels have less or equal balance than their reserve, show a warning */} - {channels?.every( - (channel) => - channel.localBalance <= - channel.unspendablePunishmentReserve * 1000 - ) && ( - - - Channel reserves unmet - - You won't be able to make payments until you{" "} - - increase your spending balance. - - - - )} )} diff --git a/lnclient/ldk/ldk.go b/lnclient/ldk/ldk.go index d34c0e12..a459a83f 100644 --- a/lnclient/ldk/ldk.go +++ b/lnclient/ldk/ldk.go @@ -797,13 +797,16 @@ func (ls *LDKService) ListChannels(ctx context.Context) ([]lnclient.Channel, err var channelError *string - if ldkChannel.CounterpartyForwardingInfoFeeBaseMsat == nil { + if fundingTxId == "" { + channelErrorValue := "This channel has no funding transaction. Please contact support@getalby.com" + channelError = &channelErrorValue + } else if ldkChannel.IsUsable && ldkChannel.CounterpartyForwardingInfoFeeBaseMsat == nil { // if we don't have this, routing will not work (LND <-> LDK interoperability bug - https://github.com/lightningnetwork/lnd/issues/6870 ) channelErrorValue := "Counterparty forwarding info not available. Please contact support@getalby.com" channelError = &channelErrorValue } - isActive := ldkChannel.IsUsable /* superset of ldkChannel.IsReady */ && channelError == nil && fundingTxId != "" + isActive := ldkChannel.IsUsable /* superset of ldkChannel.IsReady */ && channelError == nil channels = append(channels, lnclient.Channel{ InternalChannel: internalChannel,