From c3175112fe7bb23fc6fe9b2aa0ffaaf2ee430898 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 6 Aug 2021 11:31:31 +0300 Subject: [PATCH] network: fix Ping messages * NewPing() accepts block index first and nonce then. * Block height should be used, it'll be important for state exchanging nodes --- pkg/network/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index f36677d25..4a1b0ce3e 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -314,7 +314,7 @@ func (s *Server) runProto() { if s.chain.BlockHeight() == prevHeight { // Get a copy of s.peers to avoid holding a lock while sending. 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)