@@ -1042,18 +1042,19 @@ func (wn *WebsocketNetwork) ServeHTTP(response http.ResponseWriter, request *htt
10421042
10431043 client , _ := wn .GetHTTPClient (trackedRequest .remoteAddress ())
10441044 peer := & wsPeer {
1045- wsPeerCore : makePeerCore (wn .ctx , wn , wn .log , wn .handler .readBuffer , trackedRequest .remoteAddress (), client , trackedRequest .remoteHost ),
1046- conn : wsPeerWebsocketConnImpl {conn },
1047- outgoing : false ,
1048- InstanceName : trackedRequest .otherInstanceName ,
1049- incomingMsgFilter : wn .incomingMsgFilter ,
1050- prioChallenge : challenge ,
1051- createTime : trackedRequest .created ,
1052- version : matchingVersion ,
1053- identity : peerID ,
1054- identityChallenge : peerIDChallenge ,
1055- identityVerified : atomic.Uint32 {},
1056- features : decodePeerFeatures (matchingVersion , request .Header .Get (PeerFeaturesHeader )),
1045+ wsPeerCore : makePeerCore (wn .ctx , wn , wn .log , wn .handler .readBuffer , trackedRequest .remoteAddress (), client , trackedRequest .remoteHost ),
1046+ conn : wsPeerWebsocketConnImpl {conn },
1047+ outgoing : false ,
1048+ InstanceName : trackedRequest .otherInstanceName ,
1049+ incomingMsgFilter : wn .incomingMsgFilter ,
1050+ prioChallenge : challenge ,
1051+ createTime : trackedRequest .created ,
1052+ version : matchingVersion ,
1053+ identity : peerID ,
1054+ identityChallenge : peerIDChallenge ,
1055+ identityVerified : atomic.Uint32 {},
1056+ features : decodePeerFeatures (matchingVersion , request .Header .Get (PeerFeaturesHeader )),
1057+ enableVoteCompression : wn .config .EnableVoteCompression ,
10571058 }
10581059 peer .TelemetryGUID = trackedRequest .otherTelemetryGUID
10591060 peer .init (wn .config , wn .outgoingMessagesBufferSize )
@@ -1394,6 +1395,8 @@ func (wn *msgBroadcaster) innerBroadcast(request broadcastRequest, prio bool, pe
13941395 continue
13951396 }
13961397 dataToSend := data
1398+ // check whether to send a compressed vote. dataWithCompression will be empty if this node
1399+ // has not enabled vote compression.
13971400 if peer .vpackVoteCompressionSupported () && len (dataWithCompression ) > 0 {
13981401 dataToSend = dataWithCompression
13991402 }
@@ -2148,6 +2151,7 @@ func (wn *WebsocketNetwork) tryConnect(netAddr, gossipAddr string) {
21482151 version : matchingVersion ,
21492152 identity : peerID ,
21502153 features : decodePeerFeatures (matchingVersion , response .Header .Get (PeerFeaturesHeader )),
2154+ enableVoteCompression : wn .config .EnableVoteCompression ,
21512155 }
21522156 peer .TelemetryGUID , peer .InstanceName , _ = getCommonHeaders (response .Header )
21532157
0 commit comments