Skip to content

Commit

Permalink
fix: channel warnings (#397)
Browse files Browse the repository at this point in the history
- do not show forwarding fee error if channel is opening
- remove alert for low spending capacity
  • Loading branch information
rolznz authored Aug 6, 2024
1 parent fef85eb commit 26a003f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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=
Expand Down
18 changes: 0 additions & 18 deletions frontend/src/screens/channels/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,24 +409,6 @@ export default function Channels() {
</AlertDescription>
</Alert>
)}

{/* If all channels have less or equal balance than their reserve, show a warning */}
{channels?.every(
(channel) =>
channel.localBalance <=
channel.unspendablePunishmentReserve * 1000
) && (
<Alert>
<AlertTriangle className="h-4 w-4" />
<AlertTitle>Channel reserves unmet</AlertTitle>
<AlertDescription>
You won't be able to make payments until you{" "}
<Link className="underline" to="/channels/outgoing">
increase your spending balance.
</Link>
</AlertDescription>
</Alert>
)}
</>
)}

Expand Down
7 changes: 5 additions & 2 deletions lnclient/ldk/ldk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 26a003f

Please sign in to comment.