From 482b2e6f237dbd4e69d2dc527b2daf89c5005761 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 10:04:15 +0100 Subject: [PATCH] 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 --- pkg/node/peer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 4ddac60..e3bc117 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -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()