mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +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 header.UncleHash != types.EmptyUncleHash || header.TxHash != types.EmptyRootHash ||
|
||||
(header.WithdrawalsHash != nil && *header.WithdrawalsHash != types.EmptyRootHash) {
|
||||
if header.UncleHash == types.EmptyUncleHash && header.TxHash == 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
|
||||
block := rawdb.ReadBlock(tx, hash, blockNum)
|
||||
if block != nil {
|
||||
bd.addBodyToCache(blockNum, block.RawBody())
|
||||
request = false
|
||||
}
|
||||
} else {
|
||||
bd.addBodyToCache(blockNum, &types.RawBody{})
|
||||
request = false
|
||||
}
|
||||
}
|
||||
if request {
|
||||
|
Loading…
Reference in New Issue
Block a user