Skip to content

rpcserver: fix stats undercount in GetNetworkInfo#10963

Merged
ziggie1984 merged 1 commit into
lightningnetwork:masterfrom
elnosh:fix-networkinfo
Jul 13, 2026
Merged

rpcserver: fix stats undercount in GetNetworkInfo#10963
ziggie1984 merged 1 commit into
lightningnetwork:masterfrom
elnosh:fix-networkinfo

Conversation

@elnosh

@elnosh elnosh commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

I was seeing dubious numbers from getnetworkinfo command which did not match at all to the graph from describegraph.

Seems the issue is that it is returning early instead of continuing in the loop in GetNetworkInfo so it ended up under counting the stats.

Finding the issue in the code was LLM-assisted

@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label Jul 11, 2026
@github-actions

Copy link
Copy Markdown

🔴 PR Severity: CRITICAL

Explicit rule match | 1 file | 7 lines changed

🔴 Critical (1 file)
  • rpcserver.go - Core server coordination file, explicitly listed as a CRITICAL path (RPC entry point / core server logic)

Analysis

The only file changed is rpcserver.go, which is explicitly named in the CRITICAL tier as a core server coordination file. The change itself is small (3 additions, 4 deletions) and fixes a control-flow bug in GetNetworkInfo where the loop was returning early instead of continuing, causing undercounted network stats. While the fix is narrowly scoped and low-risk in nature, the file itself warrants expert review per the classification rules, and the size of the diff does not qualify for a severity bump (only 7 lines changed, well under the 500-line/20-file thresholds) nor does it warrant a downgrade — file-based classification takes precedence.


To override, add a severity-override-{critical,high,medium,low} label.

@ziggie1984 ziggie1984 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the fix

@ziggie1984

Copy link
Copy Markdown
Collaborator

Could you add release notes for LND 22

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.
@elnosh
elnosh force-pushed the fix-networkinfo branch from 3ebc655 to 9ccd305 Compare July 13, 2026 13:29
@elnosh

elnosh commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

done

@ziggie1984
ziggie1984 enabled auto-merge July 13, 2026 14:18
@ziggie1984
ziggie1984 merged commit 02f4116 into lightningnetwork:master Jul 13, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-critical Requires expert review - security/consensus critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants