From c0a453a53b1553161e3ee6c799c9acfdbdecd1ac Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 28 Dec 2022 12:50:30 +0300 Subject: [PATCH] network: adjust requestBlocs logic If the lastQueued block index is the same as the one we'd like to request in payload, then we need to increment the payload's count. --- 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 e9ce7c2bb..898d4246f 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -1250,7 +1250,7 @@ func (s *Server) requestBlocks(bq Blockqueuer, p Peer) error { h := bq.BlockHeight() pl := getRequestBlocksPayload(p, h, &s.lastRequestedBlock) lq := s.bQueue.lastQueued() - if lq > pl.IndexStart { + if lq >= pl.IndexStart { c := int16(h + blockCacheSize - lq) if c < payload.MaxHashesCount { pl.Count = c