rpcserver: correct avg degree in GetNetworkInfo

Average degree of graph is calculated as twice the number of edges devided by number of vertices
This commit is contained in:
Ondrej Calda 2019-03-24 13:22:15 +01:00 committed by GitHub
parent 6ad8be25e1
commit 7fe2f9e2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4033,7 +4033,7 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
// * also add median channel size // * also add median channel size
netInfo := &lnrpc.NetworkInfo{ netInfo := &lnrpc.NetworkInfo{
MaxOutDegree: maxChanOut, MaxOutDegree: maxChanOut,
AvgOutDegree: float64(numChannels) / float64(numNodes), AvgOutDegree: float64(2*numChannels) / float64(numNodes),
NumNodes: numNodes, NumNodes: numNodes,
NumChannels: numChannels, NumChannels: numChannels,
TotalNetworkCapacity: int64(totalNetworkCapacity), TotalNetworkCapacity: int64(totalNetworkCapacity),