mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
rpcserver: query and set num_zombie_chans in NetworkInfo resp
This commit is contained in:
parent
0223039fb4
commit
97d8be7f6a
1 changed files with 7 additions and 0 deletions
|
@ -3999,6 +3999,12 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Query the graph for the current number of zombie channels.
|
||||
numZombies, err := graph.NumZombies()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Find the median.
|
||||
medianChanSize = autopilot.Median(allChans)
|
||||
|
||||
|
@ -4022,6 +4028,7 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
|
|||
MinChannelSize: int64(minChannelSize),
|
||||
MaxChannelSize: int64(maxChannelSize),
|
||||
MedianChannelSizeSat: int64(medianChanSize),
|
||||
NumZombieChans: numZombies,
|
||||
}
|
||||
|
||||
// Similarly, if we don't have any channels, then we'll also set the
|
||||
|
|
Loading…
Add table
Reference in a new issue