hopHistogram

fun hopHistogram(nodes: List<Node>, cutoffSecs: Int?): List<Int>(source)

Counts nodes at each hop distance, as a list indexed by hop (element 0 = direct nodes). The list is contiguous from hop 0 up to the furthest hop observed, so zero-count gaps in the middle are preserved. Nodes with an unknown hop (hopsAway < 0) are excluded. When cutoffSecs is non-null, only nodes with lastHeard >= cutoffSecs are counted. Returns an empty list when nothing qualifies.