ax(node): replace prose description with usage example on SelectNearestPeers

AX principle 2: comments show HOW with real values, not WHAT the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 10:04:15 +01:00
parent c8edfee8ae
commit 482b2e6f23
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -508,7 +508,8 @@ func (r *PeerRegistry) SelectOptimalPeer() *Peer {
return &peerCopy
}
// SelectNearestPeers returns the n best peers based on multi-factor optimization.
// peers := registry.SelectNearestPeers(3) // top 3 peers by ping, hops, geo, score
// for _, peer := range peers { ctrl.ConnectToPeer(peer.ID) }
func (r *PeerRegistry) SelectNearestPeers(n int) []*Peer {
r.mutex.RLock()
defer r.mutex.RUnlock()