Skip to content

Commit 0ea0302

Browse files
committed
make even shorter
1 parent efcaf45 commit 0ea0302

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

network/wsNetwork.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,13 +1193,8 @@ func (wn *WebsocketNetwork) maybeSendMessagesOfInterest(peer *wsPeer, messagesOf
11931193
if !peer.vpackStatefulCompressionSupported() && wn.messagesOfInterest[protocol.VotePackedTag] {
11941194
// filter VP tag for peers lacking stateful compression support
11951195
// older nodes (<= v4.3) treat unknown tags as protocol violations and disconnect.
1196-
perPeerTags := make(map[protocol.Tag]bool, len(wn.messagesOfInterest))
1197-
for tag, flag := range wn.messagesOfInterest {
1198-
if tag == protocol.VotePackedTag {
1199-
continue
1200-
}
1201-
perPeerTags[tag] = flag
1202-
}
1196+
perPeerTags := maps.Clone(wn.messagesOfInterest)
1197+
delete(perPeerTags, protocol.VotePackedTag)
12031198
messagesOfInterestEnc = marshallMessageOfInterestMap(perPeerTags)
12041199
}
12051200
wn.messagesOfInterestMu.Unlock()

0 commit comments

Comments
 (0)