diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 21d17e1..8385f20 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -109,8 +109,8 @@ type PeerRegistry struct { dirty bool // Whether there are unsaved changes saveTimer *time.Timer // Timer for debounced save saveMutex sync.Mutex // Protects dirty and saveTimer - stopChan chan struct{} // Signal to stop background save - saveStopOnce sync.Once // Ensure stopChan is closed only once + stopChannel chan struct{} // Signal to stop background save + saveStopOnce sync.Once // Ensure stopChannel is closed only once } // Dimension weights for peer selection. @@ -139,7 +139,7 @@ func NewPeerRegistryWithPath(peersPath string) (*PeerRegistry, error) { registry := &PeerRegistry{ peers: make(map[string]*Peer), peersFilePath: peersPath, - stopChan: make(chan struct{}), + stopChannel: make(chan struct{}), authMode: PeerAuthOpen, // Default to open for backward compatibility allowedPublicKeys: make(map[string]bool), } @@ -662,7 +662,7 @@ func (registry *PeerRegistry) saveNow() error { // defer registry.Close() // flush pending writes on shutdown func (registry *PeerRegistry) Close() error { registry.saveStopOnce.Do(func() { - close(registry.stopChan) + close(registry.stopChannel) }) // Cancel pending timer and save immediately if dirty