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 authored and GitHub committed 2019-03-24 13:22:15 +01:00
1 parent 6ad8be25e1
commit 7fe2f9e2a5
1 file changed
+1 -1
+1 -1
View File
@@ -4033,7 +4033,7 @@ func (r *rpcServer) GetNetworkInfo(ctx context.Context,
// * also add median channel size
netInfo := &lnrpc.NetworkInfo{
MaxOutDegree: maxChanOut,
AvgOutDegree: float64(numChannels) / float64(numNodes),
AvgOutDegree: float64(2*numChannels) / float64(numNodes),
NumNodes: numNodes,
NumChannels: numChannels,
TotalNetworkCapacity: int64(totalNetworkCapacity),