Skip to content

Commit 35b91f1

Browse files
committed
simplify
1 parent 0d5303f commit 35b91f1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

network/wsNetwork.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,17 +1194,15 @@ func (wn *WebsocketNetwork) maybeSendMessagesOfInterest(peer *wsPeer, messagesOf
11941194
if sendEnc == nil {
11951195
sendEnc = wn.messagesOfInterestEnc
11961196
}
1197-
if !peerSupportsStatefulCompression {
1197+
if !peerSupportsStatefulCompression && wn.messagesOfInterest[protocol.VotePackedTag] {
11981198
// Filter VP tag for peers lacking stateful compression support; older nodes (<= v4.3)
11991199
// treat unknown tags as protocol violations and disconnect.
1200-
if wn.messagesOfInterest[protocol.VotePackedTag] {
1201-
perPeerTags = make(map[protocol.Tag]bool, len(wn.messagesOfInterest))
1202-
for tag, flag := range wn.messagesOfInterest {
1203-
if tag == protocol.VotePackedTag {
1204-
continue
1205-
}
1206-
perPeerTags[tag] = flag
1200+
perPeerTags = make(map[protocol.Tag]bool, len(wn.messagesOfInterest))
1201+
for tag, flag := range wn.messagesOfInterest {
1202+
if tag == protocol.VotePackedTag {
1203+
continue
12071204
}
1205+
perPeerTags[tag] = flag
12081206
}
12091207
}
12101208
wn.messagesOfInterestMu.Unlock()

0 commit comments

Comments
 (0)