mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 17:52:25 +01:00
lnrpc: deprecate unused pending closing channels field
The pending closing channels field was present to cover an edge case where coperatively closed channels were closed before upgrade and confirmed after the upgrade. This commit deprecates the field and adds a warning log to cover these edge cases.
This commit is contained in:
parent
8b83c1f7f9
commit
9e1cdb78e7
1394
lnrpc/rpc.pb.go
1394
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load Diff
@ -2096,8 +2096,12 @@ message PendingChannelsResponse {
|
||||
/// Channels pending opening
|
||||
repeated PendingOpenChannel pending_open_channels = 2;
|
||||
|
||||
/// Channels pending closing
|
||||
repeated ClosedChannel pending_closing_channels = 3;
|
||||
/*
|
||||
Deprecated: Channels pending closing previously contained cooperatively
|
||||
closed channels with a single confirmation. These channels are now
|
||||
considered closed from the time we see them on chain.
|
||||
*/
|
||||
repeated ClosedChannel pending_closing_channels = 3 [deprecated = true];
|
||||
|
||||
/// Channels pending force closing
|
||||
repeated ForceClosedChannel pending_force_closing_channels = 4;
|
||||
|
@ -3939,7 +3939,7 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/PendingChannelsResponseClosedChannel"
|
||||
},
|
||||
"title": "/ Channels pending closing"
|
||||
"description": "Deprecated: Channels pending closing previously contained cooperatively\nclosed channels with a single confirmation. These channels are now\nconsidered closed from the time we see them on chain."
|
||||
},
|
||||
"pending_force_closing_channels": {
|
||||
"type": "array",
|
||||
|
23
rpcserver.go
23
rpcserver.go
@ -2725,22 +2725,15 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
|
||||
|
||||
switch pendingClose.CloseType {
|
||||
|
||||
// If the channel was closed cooperatively, then we'll only
|
||||
// need to tack on the closing txid.
|
||||
// TODO(halseth): remove. After recent changes, a coop closed
|
||||
// channel should never be in the "pending close" state.
|
||||
// Keeping for now to let someone that upgraded in the middle
|
||||
// of a close let their closing tx confirm.
|
||||
// A coop closed channel should never be in the "pending close"
|
||||
// state. If a node upgraded from an older lnd version in the
|
||||
// middle of a their channel confirming, it will be in this
|
||||
// state. We log a warning that the channel will not be included
|
||||
// in the now deprecated pending close channels field.
|
||||
case channeldb.CooperativeClose:
|
||||
resp.PendingClosingChannels = append(
|
||||
resp.PendingClosingChannels,
|
||||
&lnrpc.PendingChannelsResponse_ClosedChannel{
|
||||
Channel: channel,
|
||||
ClosingTxid: closeTXID,
|
||||
},
|
||||
)
|
||||
|
||||
resp.TotalLimboBalance += channel.LocalBalance
|
||||
rpcsLog.Warn("channel %v cooperatively closed and "+
|
||||
"in pending close state",
|
||||
pendingClose.ChanPoint)
|
||||
|
||||
// If the channel was force closed, then we'll need to query
|
||||
// the utxoNursery for additional information.
|
||||
|
Loading…
x
Reference in New Issue
Block a user