eth/protocols/eth: handle Count Zero

This commit is contained in:
Martin Holst Swende 2024-08-15 15:00:22 +02:00
parent c35684709c
commit 08bb58b482
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -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