Skip to content

Commit 3e56b87

Browse files
committed
make even shorter
1 parent efcaf45 commit 3e56b87

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

network/wsNetwork.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,15 +1191,8 @@ func (wn *WebsocketNetwork) maybeSendMessagesOfInterest(peer *wsPeer, messagesOf
11911191
messagesOfInterestEnc = wn.messagesOfInterestEnc
11921192
}
11931193
if !peer.vpackStatefulCompressionSupported() && wn.messagesOfInterest[protocol.VotePackedTag] {
1194-
// filter VP tag for peers lacking stateful compression support
1195-
// 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-
}
1194+
perPeerTags := maps.Clone(wn.messagesOfInterest)
1195+
delete(perPeerTags, protocol.VotePackedTag)
12031196
messagesOfInterestEnc = marshallMessageOfInterestMap(perPeerTags)
12041197
}
12051198
wn.messagesOfInterestMu.Unlock()

0 commit comments

Comments
 (0)