From 074ba5f3943db53b15b0ed91bdff40ddce6e7d4f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 7 Dec 2020 18:40:04 +0300 Subject: [PATCH] network: fix GetBlocks command Return exactly requested amount of hashes. --- 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 78d6bc559..10970a301 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -595,7 +595,7 @@ func (s *Server) handleGetBlocksCmd(p Peer, gb *payload.GetBlocks) error { return err } blockHashes := make([]util.Uint256, 0) - for i := start.Index + 1; i < start.Index+uint32(count); i++ { + for i := start.Index + 1; i <= start.Index+uint32(count); i++ { hash := s.chain.GetHeaderHash(int(i)) if hash.Equals(util.Uint256{}) { break