tuweni / org.apache.tuweni.kademlia / KademliaRoutingTable / nearest

nearest

fun nearest(targetId: ByteArray, limit: Int): List<T> (source)

Return the nearest nodes to a target id, in order from closest to furthest.

The sort order is the log distance from the target id to the node ids.

Parameters

targetId - the id to find nodes nearest to

limit - the maximum number of nodes to return

Return
a list of nodes from the routing table