Skip to content

rpcserver: expose the opening push amount for closed channels - #11599

Closed
AmanBoronbaev wants to merge 2 commits into
lightningnetwork:masterfrom
AmanBoronbaev:closed-channel-push-amount
Closed

AmanBoronbaev wants to merge 2 commits into
lightningnetwork:masterfrom
AmanBoronbaev:closed-channel-push-amount

Conversation

@AmanBoronbaev

@AmanBoronbaev AmanBoronbaev commented Nov 21, 2026 •

Copy link
Copy Markdown

Closes #4490.

ClosedChannels now returns push_amount_sat, the amount the initiator sent to the other peer when opening the channel. It uses the same opening balance as ListChannels on either side of the channel. The close-summary path already loads the historical channel, so this adds no database read or migration.

The value is zero when no funds were pushed or this node lacks the original opening balances. Some older records were migrated with zero balances. The settled balance at close cannot recover the original push.

The protobuf and REST schemas include the new field. The unit test checks both parties’ views, zero push and sub-satoshi truncation. In the regtest integration case, Alice pushes 5,000,000 sat to Bob, a cooperative close is reorganized, and both nodes report 5,000,000 sat in their closed-channel summaries after final confirmation.

Verification

go test -run '^TestChannelPushAmountSat$' .
make itest icase=coop_close_rbf_with_reorg

Both passed locally using the btcd backend. The protobuf and OpenAPI outputs were regenerated with the project’s pinned compiler and generators.

Report the initial balance of the non-initiating party in both channel listings. The close summary already loads the historical opening state, so reporting the push does not add a database lookup.
@github-actions github-actions Bot added the ci-hold CI is held; remove this label to run CI label Nov 21, 2026
@AmanBoronbaev
AmanBoronbaev marked this pull request as ready for review November 21, 2026 10:14
@saubyk

saubyk commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Hi @AmanBoronbaev, thanks for taking the time to put this together.

Per the new contributor section of the contribution guidelines, we don't prioritize review of PRs from authors without a track record in the project. Given the current review load, I'm closing this rather than letting it sit.

Since #4490 already covers this, we'll handle it from that issue; if a fix is warranted a maintainer will pick it up.

If you'd like to contribute going forward, reviewing open PRs and helping triage issues is the path we recommend. It's a stronger signal of understanding than a first patch, and it makes it a lot easier for us to prioritize your PRs later.

@saubyk saubyk closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-hold CI is held; remove this label to run CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accounting for pushed funds after the channel is closed

2 participants