tuweni / org.apache.tuweni.devp2p / PeerRoutingTable / nearest

nearest

abstract fun nearest(targetId: PublicKey, limit: Int): List<Peer> (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 to the node-id's of the Peers.

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