Merge pull request #5931 from yyforyongyu/5924-remote-balance

rpcserver: add remote balance for pending force close
This commit is contained in:
Oliver Gugger 2021-12-14 10:02:23 +01:00 committed by GitHub
commit 6d59a2c807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,13 @@
* [Allow disabling migrations if the database backend passed to `channeldb` was
opened in read-only mode](https://github.com/lightningnetwork/lnd/pull/6084).
## RPC Server
* [Add value to the field
`remote_balance`](https://github.com/lightningnetwork/lnd/pull/5931) in
`pending_force_closing_channels` under `pendingchannels` whereas before was
empty(zero).
## Code Health
### Code cleanup, refactor, typo fixes

View File

@ -3317,6 +3317,10 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
}
channel.NumForwardingPackages = int64(len(fwdPkgs))
channel.RemoteBalance = int64(
historical.LocalCommitment.RemoteBalance.ToSatoshis(),
)
// If the error is non-nil, and not due to older versions of lnd
// not persisting historical channels, return it.
default: