From 39e0df4de3d14360e123360d52e512a2fa09ab8a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:13:10 +0100 Subject: [PATCH] ax(node): replace AddPeer prose comment with usage example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 2: comments restate the signature — replace with a concrete call showing realistic values and the debounce behaviour as a note. Co-Authored-By: Charon --- pkg/node/peer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 3331f2c..855261f 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -232,9 +232,8 @@ func (r *PeerRegistry) ListAllowedPublicKeys() []string { return keys } -// AddPeer adds a new peer to the registry. -// Note: Persistence is debounced (writes batched every 5s). Call Close() to ensure -// all changes are flushed to disk before shutdown. +// registry.AddPeer(&Peer{ID: "abc123", Name: "worker-1", Address: "10.0.0.2:9090", Role: RoleWorker}) +// Persistence is debounced — call Close() before shutdown to flush all pending writes. func (r *PeerRegistry) AddPeer(peer *Peer) error { r.mu.Lock()