mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +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:
parent
be1a96b78a
commit
9a32bee171
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user