rpcserver: fix stats undercount in GetNetworkInfo

On an already-seen channel, the loop returned from the whole node
callback instead of continuing, skipping the node's remaining
channels, this undercounted the stats.
This commit is contained in:
elnosh 2026-07-11 13:19:41 -04:00
parent 404f2c27ab
commit 9ccd305692
2 changed files with 9 additions and 4 deletions

View file

@ -49,6 +49,12 @@
exclude such inputs from sweeping even though their input set could
comfortably pay its fees.
* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/10963) in
`GetNetworkInfo` where encountering an already-seen channel skipped the
rest of that node's channels instead of just that channel, undercounting
the reported network statistics such as total network capacity, channel
count and max out degree.
# New Features
## Functional Enhancements

View file

@ -6681,11 +6681,10 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
// channel encountered.
outDegree++
// If we've already seen this channel, then we'll
// return early to ensure that we don't double-count
// stats.
// If we've already seen this channel, skip it to
// ensure that we don't double-count stats.
if _, ok := seenChans[edge.ChannelID]; ok {
return nil
continue
}
// Compare the capacity of this channel against the