rpcserver: query and set num_zombie_chans in NetworkInfo resp

This commit is contained in:
Conner Fromknecht 2019-07-15 16:59:31 -07:00
parent 0223039fb4
commit 97d8be7f6a
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

View File

@ -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