mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
eth/downloader: add missing Requests
This commit is contained in:
parent
ec69830b6f
commit
caa25017c3
1 changed files with 10 additions and 2 deletions
|
|
@ -70,6 +70,7 @@ type fetchResult struct {
|
||||||
Transactions types.Transactions
|
Transactions types.Transactions
|
||||||
Receipts types.Receipts
|
Receipts types.Receipts
|
||||||
Withdrawals types.Withdrawals
|
Withdrawals types.Withdrawals
|
||||||
|
Requests types.Requests
|
||||||
}
|
}
|
||||||
|
|
||||||
func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
|
func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
|
||||||
|
|
@ -78,9 +79,14 @@ func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
|
||||||
}
|
}
|
||||||
if !header.EmptyBody() {
|
if !header.EmptyBody() {
|
||||||
item.pending.Store(item.pending.Load() | (1 << bodyType))
|
item.pending.Store(item.pending.Load() | (1 << bodyType))
|
||||||
} else if header.WithdrawalsHash != nil {
|
} else {
|
||||||
|
if header.WithdrawalsHash != nil {
|
||||||
item.Withdrawals = make(types.Withdrawals, 0)
|
item.Withdrawals = make(types.Withdrawals, 0)
|
||||||
}
|
}
|
||||||
|
if header.RequestsHash != nil {
|
||||||
|
item.Requests = make(types.Requests, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
if fastSync && !header.EmptyReceipts() {
|
if fastSync && !header.EmptyReceipts() {
|
||||||
item.pending.Store(item.pending.Load() | (1 << receiptType))
|
item.pending.Store(item.pending.Load() | (1 << receiptType))
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +99,7 @@ func (f *fetchResult) body() types.Body {
|
||||||
Transactions: f.Transactions,
|
Transactions: f.Transactions,
|
||||||
Uncles: f.Uncles,
|
Uncles: f.Uncles,
|
||||||
Withdrawals: f.Withdrawals,
|
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.Transactions = txLists[index]
|
||||||
result.Uncles = uncleLists[index]
|
result.Uncles = uncleLists[index]
|
||||||
result.Withdrawals = withdrawalLists[index]
|
result.Withdrawals = withdrawalLists[index]
|
||||||
|
result.Requests = requestsLists[index]
|
||||||
result.SetBodyDone()
|
result.SetBodyDone()
|
||||||
}
|
}
|
||||||
return q.deliver(id, q.blockTaskPool, q.blockTaskQueue, q.blockPendPool,
|
return q.deliver(id, q.blockTaskPool, q.blockTaskQueue, q.blockPendPool,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue