Skip to content

Commit caa2501

Browse files
committed
eth/downloader: add missing Requests
1 parent ec69830 commit caa2501

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

eth/downloader/queue.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ type fetchResult struct {
7070
Transactions types.Transactions
7171
Receipts types.Receipts
7272
Withdrawals types.Withdrawals
73+
Requests types.Requests
7374
}
7475

7576
func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
@@ -78,8 +79,13 @@ func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
7879
}
7980
if !header.EmptyBody() {
8081
item.pending.Store(item.pending.Load() | (1 << bodyType))
81-
} else if header.WithdrawalsHash != nil {
82-
item.Withdrawals = make(types.Withdrawals, 0)
82+
} else {
83+
if header.WithdrawalsHash != nil {
84+
item.Withdrawals = make(types.Withdrawals, 0)
85+
}
86+
if header.RequestsHash != nil {
87+
item.Requests = make(types.Requests, 0)
88+
}
8389
}
8490
if fastSync && !header.EmptyReceipts() {
8591
item.pending.Store(item.pending.Load() | (1 << receiptType))
@@ -93,6 +99,7 @@ func (f *fetchResult) body() types.Body {
9399
Transactions: f.Transactions,
94100
Uncles: f.Uncles,
95101
Withdrawals: f.Withdrawals,
102+
Requests: f.Requests,
96103
}
97104
}
98105

@@ -860,6 +867,7 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, txListH
860867
result.Transactions = txLists[index]
861868
result.Uncles = uncleLists[index]
862869
result.Withdrawals = withdrawalLists[index]
870+
result.Requests = requestsLists[index]
863871
result.SetBodyDone()
864872
}
865873
return q.deliver(id, q.blockTaskPool, q.blockTaskQueue, q.blockPendPool,

0 commit comments

Comments
 (0)