-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: LDK mark channel as inactive and show error if counterparty forw…
…arding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing
- Loading branch information
Showing
4 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -833,21 +833,32 @@ func (ls *LDKService) ListChannels(ctx context.Context) ([]lnclient.Channel, err | |
unspendablePunishmentReserve = *ldkChannel.UnspendablePunishmentReserve | ||
} | ||
|
||
var channelError *string | ||
|
||
if 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 [email protected]" | ||
channelError = &channelErrorValue | ||
} | ||
|
||
isActive := ldkChannel.IsUsable /* superset of ldkChannel.IsReady */ && channelError == nil | ||
|
||
channels = append(channels, lnclient.Channel{ | ||
InternalChannel: internalChannel, | ||
LocalBalance: int64(ldkChannel.ChannelValueSats*1000 - ldkChannel.InboundCapacityMsat - ldkChannel.CounterpartyUnspendablePunishmentReserve*1000), | ||
LocalSpendableBalance: int64(ldkChannel.OutboundCapacityMsat), | ||
RemoteBalance: int64(ldkChannel.InboundCapacityMsat), | ||
RemotePubkey: ldkChannel.CounterpartyNodeId, | ||
Id: ldkChannel.UserChannelId, // CloseChannel takes the UserChannelId | ||
Active: ldkChannel.IsUsable, // superset of ldkChannel.IsReady | ||
Active: isActive, | ||
Public: ldkChannel.IsPublic, | ||
FundingTxId: fundingTxId, | ||
Confirmations: ldkChannel.Confirmations, | ||
ConfirmationsRequired: ldkChannel.ConfirmationsRequired, | ||
ForwardingFeeBaseMsat: ldkChannel.Config.ForwardingFeeBaseMsat(), | ||
UnspendablePunishmentReserve: unspendablePunishmentReserve, | ||
CounterpartyUnspendablePunishmentReserve: ldkChannel.CounterpartyUnspendablePunishmentReserve, | ||
Error: channelError, | ||
}) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters