mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
eth/downloader: fix missing receipt (#31952)
This fixes a regression introduced by #29158 where receipts of empty blocks were stored into the database as an empty byte array, instead of an RLP empty list. Fixes #31938 --------- Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
35c5b4fafd
commit
5346b8ff28
1 changed files with 7 additions and 2 deletions
|
|
@ -83,8 +83,13 @@ func newFetchResult(header *types.Header, snapSync bool) *fetchResult {
|
|||
} else if header.WithdrawalsHash != nil {
|
||||
item.Withdrawals = make(types.Withdrawals, 0)
|
||||
}
|
||||
if snapSync && !header.EmptyReceipts() {
|
||||
item.pending.Store(item.pending.Load() | (1 << receiptType))
|
||||
if snapSync {
|
||||
if header.EmptyReceipts() {
|
||||
// Ensure the receipts list is valid even if it isn't actively fetched.
|
||||
item.Receipts = rlp.EmptyList
|
||||
} else {
|
||||
item.pending.Store(item.pending.Load() | (1 << receiptType))
|
||||
}
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue