From 3765f28a1b4d1ea67c6a190e97e628cdf10a3e95 Mon Sep 17 00:00:00 2001 From: Ocenka Date: Tue, 5 Aug 2025 15:36:41 +0100 Subject: [PATCH] Update peer.go --- p2p/peer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/p2p/peer.go b/p2p/peer.go index 9a0a750ac8..10909d6f7d 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -173,8 +173,9 @@ func (p *Peer) Fullname() string { // Caps returns the capabilities (supported subprotocols) of the remote peer. func (p *Peer) Caps() []Cap { - // TODO: maybe return copy - return p.rw.caps + capsCopy := make([]Cap, len(p.rw.caps)) + copy(capsCopy, p.rw.caps) + return capsCopy } // RunningCap returns true if the peer is actively connected using any of the