mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
Merge pull request #5797 from guggero/fix-nil-channel
rpcserver: fix nil issue with historical channels
This commit is contained in:
commit
410606b082
1 changed files with 11 additions and 11 deletions
22
rpcserver.go
22
rpcserver.go
|
@ -3234,23 +3234,23 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
|
|||
historical.ChanType,
|
||||
)
|
||||
|
||||
// Get the number of forwarding packages from the
|
||||
// historical channel.
|
||||
fwdPkgs, err := historical.LoadFwdPkgs()
|
||||
if err != nil {
|
||||
rpcsLog.Errorf("unable to load forwarding "+
|
||||
"packages for channel:%s, %v",
|
||||
historical.ShortChannelID, err)
|
||||
return nil, err
|
||||
}
|
||||
channel.NumForwardingPackages = int64(len(fwdPkgs))
|
||||
|
||||
// If the error is non-nil, and not due to older versions of lnd
|
||||
// not persisting historical channels, return it.
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get the number of forwarding packages from the historical
|
||||
// channel.
|
||||
fwdPkgs, err := historical.LoadFwdPkgs()
|
||||
if err != nil {
|
||||
rpcsLog.Errorf("unable to load forwarding packages "+
|
||||
"for channel:%s, %v",
|
||||
historical.ShortChannelID, err)
|
||||
return nil, err
|
||||
}
|
||||
channel.NumForwardingPackages = int64(len(fwdPkgs))
|
||||
|
||||
closeTXID := pendingClose.ClosingTXID.String()
|
||||
|
||||
switch pendingClose.CloseType {
|
||||
|
|
Loading…
Add table
Reference in a new issue