From caa25017c32be8e0a0ae1f5e4b1736d4a7319dc9 Mon Sep 17 00:00:00 2001 From: islishude Date: Fri, 13 Sep 2024 09:13:51 +0800 Subject: [PATCH] eth/downloader: add missing Requests --- eth/downloader/queue.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index adad450200..474602a4bd 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -70,6 +70,7 @@ type fetchResult struct { Transactions types.Transactions Receipts types.Receipts Withdrawals types.Withdrawals + Requests types.Requests } func newFetchResult(header *types.Header, fastSync bool) *fetchResult { @@ -78,8 +79,13 @@ func newFetchResult(header *types.Header, fastSync bool) *fetchResult { } if !header.EmptyBody() { item.pending.Store(item.pending.Load() | (1 << bodyType)) - } else if header.WithdrawalsHash != nil { - item.Withdrawals = make(types.Withdrawals, 0) + } else { + if header.WithdrawalsHash != nil { + item.Withdrawals = make(types.Withdrawals, 0) + } + if header.RequestsHash != nil { + item.Requests = make(types.Requests, 0) + } } if fastSync && !header.EmptyReceipts() { item.pending.Store(item.pending.Load() | (1 << receiptType)) @@ -93,6 +99,7 @@ func (f *fetchResult) body() types.Body { Transactions: f.Transactions, Uncles: f.Uncles, Withdrawals: f.Withdrawals, + Requests: f.Requests, } } @@ -860,6 +867,7 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, txListH result.Transactions = txLists[index] result.Uncles = uncleLists[index] result.Withdrawals = withdrawalLists[index] + result.Requests = requestsLists[index] result.SetBodyDone() } return q.deliver(id, q.blockTaskPool, q.blockTaskQueue, q.blockPendPool,