Skip to content

Add aggregate Lightning balances to node info - #168

Open
Kewe63 wants to merge 1 commit into
RGB-Tools:masterfrom
Kewe63:fix-70-aggregate-lightning-balances
Open

Kewe63 wants to merge 1 commit into
RGB-Tools:masterfrom
Kewe63:fix-70-aggregate-lightning-balances

Conversation

@Kewe63

@Kewe63 Kewe63 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

  • add aggregate outbound_balance_msat and inbound_balance_msat fields to /nodeinfo
  • include only channels whose /listchannels status is Opened
  • document both fields in the OpenAPI schema
  • add regression coverage for empty, opening, ready-but-closing, and multi-channel states

Implementation

A channel contributes to the aggregate only when it is ready and not shutting down. This matches the existing ChannelStatus::Opened classification used by /listchannels.

The returned values are the sums of LDK's outbound_capacity_msat and inbound_capacity_msat values for those channels.


Validation

  • cargo +1.94.0 fmt -- --check
  • Clippy with -D warnings across all 9 CI feature combinations
  • cargo +1.94.0 test aggregate_balances_excludes_channels_that_are_not_opened
  • cargo +1.94.0 test multi_hop --no-run
  • OpenAPI YAML/schema validation
  • git diff --check

The local multi_hop integration run passed the new /nodeinfo aggregate assertions, then failed later at the pre-existing balance assertion on src/test/multi_hop.rs:258.

Fixes #70

Expose total outbound and inbound millisatoshi balances across opened channels and document the fields in the OpenAPI schema.\n\nFixes UTEXO-Protocol#70
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.77%. Comparing base (e400827) to head (5576a5a).

Files with missing lines Patch % Lines
src/routes.rs 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #168      +/-   ##
==========================================
+ Coverage   87.72%   87.77%   +0.04%     
==========================================
  Files          16       16              
  Lines        8459     8490      +31     
==========================================
+ Hits         7421     7452      +31     
  Misses       1038     1038              
Flag Coverage Δ
rust 87.77% <96.77%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add aggregated outbound and inbound vanilla lightning balance

1 participant