Skip to content

Commit

Permalink
eth/protocols/snap: make snap return data even if bytes=0
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Jan 24, 2022
1 parent b7f8218 commit 72812ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eth/protocols/snap/handler.go
Expand Up @@ -299,7 +299,7 @@ func ServiceGetAccountRangeQuery(chain *core.BlockChain, req *GetAccountRangePac
size uint64
last common.Hash
)
for it.Next() && size < req.Bytes {
for it.Next() {
hash, account := it.Hash(), common.CopyBytes(it.Account())

// Track the returned interval for the Merkle proofs
Expand All @@ -315,6 +315,9 @@ func ServiceGetAccountRangeQuery(chain *core.BlockChain, req *GetAccountRangePac
if bytes.Compare(hash[:], req.Limit[:]) >= 0 {
break
}
if size > req.Bytes {
break
}
}
it.Release()

Expand Down

0 comments on commit 72812ba

Please sign in to comment.