From 08bb58b482cb44c7fb933c41c3b9f98af6422f80 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 15 Aug 2024 15:00:22 +0200 Subject: [PATCH] eth/protocols/eth: handle Count Zero --- eth/protocols/eth/handlers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/protocols/eth/handlers.go b/eth/protocols/eth/handlers.go index bdc630a9f4..c79d8f7c04 100644 --- a/eth/protocols/eth/handlers.go +++ b/eth/protocols/eth/handlers.go @@ -144,6 +144,9 @@ func serviceContiguousBlockHeaderQuery(chain *core.BlockChain, query *GetBlockHe if count > maxHeadersServe { count = maxHeadersServe } + if count == 0 { + return nil + } if query.Origin.Hash == (common.Hash{}) { // Number mode, just return the canon chain segment. The backend // delivers in [N, N-1, N-2..] descending order, so we need to