mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-23 08:19:27 +00:00
eth/downloader: use batch index in deliver reconstruct (#34870)
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 hit a stale slot.
This commit is contained in:
parent
d5edb80438
commit
5b837e5786
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++
|
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 {
|
if res, stale, err := q.resultCache.GetDeliverySlot(header.Number.Uint64()); err == nil && !stale {
|
||||||
reconstruct(accepted, res)
|
reconstruct(k, res)
|
||||||
accepted++
|
accepted++
|
||||||
} else {
|
} else {
|
||||||
// Between here and above, some other peer filled this result,
|
// Between here and above, some other peer filled this result,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue