From f9663a97a1d8696e16d4f595f8786757d79d69bc Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 6 Aug 2021 11:26:19 +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 eeb466b7c..74e9b5502 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -426,7 +426,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(NewMessage(CMDPing, payload.NewPing(s.id, s.chain.HeaderHeight()))) + _ = peer.SendPing(NewMessage(CMDPing, payload.NewPing(s.chain.BlockHeight(), s.id))) } } pingTimer.Reset(s.PingInterval)