From 0bc582ccf78b6da4cf213bd61863f4b088a8669b Mon Sep 17 00:00:00 2001 From: egonspace Date: Fri, 2 Aug 2024 09:58:44 +0900 Subject: [PATCH] fix: protocol name --- p2p/peer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/peer.go b/p2p/peer.go index 5da61990eda3..4b7e222b5f21 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -389,11 +389,11 @@ outer: } if proto.Match(cap) { // If an old protocol version matched, revert it - if old := result[cap.Name]; old != nil { + if old := result[proto.Name]; old != nil { offset -= old.Length } // Assign the new match - result[cap.Name] = &protoRW{Protocol: proto, offset: offset, in: make(chan Msg), w: rw} + result[proto.Name] = &protoRW{Protocol: proto, offset: offset, in: make(chan Msg), w: rw} offset += proto.Length continue outer