mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 22:57:59 +01:00
rpc: a link is now only active if it is eligible to forward HTLCs
In this commit, we further constrain the candidacy for an “active” channel. In addition to being present within the link, it *must* also have the RemoteNextRevocation set. Otherwise, this indicates that we haven’t yet processed a FundingLocked message for this channel.
This commit is contained in:
@@ -1465,8 +1465,11 @@ func (r *rpcServer) ListChannels(ctx context.Context,
|
||||
|
||||
channelID := lnwire.NewChanIDFromOutPoint(&chanPoint)
|
||||
var linkActive bool
|
||||
if _, err := r.server.htlcSwitch.GetLink(channelID); err == nil {
|
||||
linkActive = true
|
||||
if link, err := r.server.htlcSwitch.GetLink(channelID); err == nil {
|
||||
// A channel is only considered active if it is known
|
||||
// by the switch *and* able to forward
|
||||
// incoming/outgoing payments.
|
||||
linkActive = link.EligibleToForward()
|
||||
}
|
||||
|
||||
// As this is required for display purposes, we'll calculate
|
||||
|
||||
Reference in New Issue
Block a user