mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
eth/downloader: use batch index in deliver reconstruct
The reconstruct callback indexes parallel response slices (bodies, receipts). Passing the accept counter used the wrong element when an earlier header in the same batch failed validation or hit a stale slot.
This commit is contained in:
parent
f0b21fa110
commit
3366ae8a96
1 changed files with 2 additions and 2 deletions
|
|
@ -689,9 +689,9 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header,
|
|||
i++
|
||||
}
|
||||
|
||||
for _, header := range request.Headers[:i] {
|
||||
for k, header := range request.Headers[:i] {
|
||||
if res, stale, err := q.resultCache.GetDeliverySlot(header.Number.Uint64()); err == nil && !stale {
|
||||
reconstruct(accepted, res)
|
||||
reconstruct(k, res)
|
||||
accepted++
|
||||
} else {
|
||||
// Between here and above, some other peer filled this result,
|
||||
|
|
|
|||
Loading…
Reference in a new issue