fix undownloaded body (#7966)

This commit is contained in:
Giulio rebuffo 2023-08-04 02:22:07 +02:00 committed by GitHub
parent d014da4dc0
commit c08aa3ac03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,7 @@ func (e *EngineBlockDownloader) downloadAndLoadBodiesSyncronously(tx kv.RwTx, fr
toProcess := e.bd.NextProcessingCount() toProcess := e.bd.NextProcessingCount()
write := true
for i := uint64(0); i < toProcess; i++ { for i := uint64(0); i < toProcess; i++ {
select { select {
case <-logEvery.C: case <-logEvery.C:
@ -108,9 +109,12 @@ func (e *EngineBlockDownloader) downloadAndLoadBodiesSyncronously(tx kv.RwTx, fr
default: default:
} }
nextBlock := requestedLow + i nextBlock := requestedLow + i
rawBody := e.bd.GetBodyFromCache(nextBlock, true) rawBody := e.bd.GetBodyFromCache(nextBlock, write)
if rawBody == nil { if rawBody == nil {
e.bd.NotDelivered(nextBlock) e.bd.NotDelivered(nextBlock)
write = false
}
if !write {
continue continue
} }