ax(node): replace prose comment with usage example on GetConnection
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled

AX Principle 2 — comments must show HOW with real values, not restate
what the signature already says. The old comment described the return
value in prose; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 11:31:36 +01:00
parent 86eff8dfc2
commit 4e10e20a6b
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -404,7 +404,8 @@ func (t *Transport) Broadcast(msg *Message) error {
return lastErr
}
// GetConnection returns an active connection to a peer.
// conn := transport.GetConnection(peer.ID)
// if conn == nil { return fmt.Errorf("peer not connected") }
func (t *Transport) GetConnection(peerID string) *PeerConnection {
t.mutex.RLock()
defer t.mutex.RUnlock()