Function sn_networking::sort_peers_by_key
source · pub fn sort_peers_by_key<'a, T>(
peers: &'a Vec<PeerId>,
key: &KBucketKey<T>,
expected_entries: usize
) -> Result<Vec<&'a PeerId>, NetworkError>
Expand description
Sort the provided peers by their distance to the given KBucketKey
.
Return with the closest expected number of entries if has.