Merge pull request #2116 from nspcc-dev/fix-pings-2.x

network: fix Ping messages
This commit is contained in:
Roman Khimov 2021-08-06 11:43:20 +03:00 committed by GitHub
commit b3a0a8f115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -314,7 +314,7 @@ func (s *Server) runProto() {
if s.chain.BlockHeight() == prevHeight { if s.chain.BlockHeight() == prevHeight {
// Get a copy of s.peers to avoid holding a lock while sending. // Get a copy of s.peers to avoid holding a lock while sending.
for peer := range s.Peers() { for peer := range s.Peers() {
_ = peer.SendPing(s.MkMsg(CMDPing, payload.NewPing(s.id, s.chain.HeaderHeight()))) _ = peer.SendPing(s.MkMsg(CMDPing, payload.NewPing(s.chain.BlockHeight(), s.id)))
} }
} }
pingTimer.Reset(s.PingInterval) pingTimer.Reset(s.PingInterval)