mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
Body downloader: fix empty withdrawals in empty bodies (#6893)
Potentially fixes Issue #6817.
This commit is contained in:
parent
433f031db3
commit
e31678f355
@ -136,17 +136,23 @@ func (bd *BodyDownload) RequestMoreBodies(tx kv.RwTx, blockReader services.FullB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if request {
|
if request {
|
||||||
if header.UncleHash != types.EmptyUncleHash || header.TxHash != types.EmptyRootHash ||
|
if header.UncleHash == types.EmptyUncleHash && header.TxHash == types.EmptyRootHash &&
|
||||||
(header.WithdrawalsHash != nil && *header.WithdrawalsHash != types.EmptyRootHash) {
|
(header.WithdrawalsHash == nil || *header.WithdrawalsHash == types.EmptyRootHash) {
|
||||||
|
// Empty block body
|
||||||
|
body := &types.RawBody{}
|
||||||
|
if header.WithdrawalsHash != nil {
|
||||||
|
// implies *header.WithdrawalsHash == types.EmptyRootHash
|
||||||
|
body.Withdrawals = make([]*types.Withdrawal, 0)
|
||||||
|
}
|
||||||
|
bd.addBodyToCache(blockNum, body)
|
||||||
|
request = false
|
||||||
|
} else {
|
||||||
// Perhaps we already have this block
|
// Perhaps we already have this block
|
||||||
block := rawdb.ReadBlock(tx, hash, blockNum)
|
block := rawdb.ReadBlock(tx, hash, blockNum)
|
||||||
if block != nil {
|
if block != nil {
|
||||||
bd.addBodyToCache(blockNum, block.RawBody())
|
bd.addBodyToCache(blockNum, block.RawBody())
|
||||||
request = false
|
request = false
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
bd.addBodyToCache(blockNum, &types.RawBody{})
|
|
||||||
request = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if request {
|
if request {
|
||||||
|
Loading…
Reference in New Issue
Block a user