Skip to content

BlockBodiesResponse.Unpack

Source (upstream pre-purge) Current
File eth/protocols/eth/protocol.go protocol_pow.go
Symbol BlockBodiesResponse.Unpack BlockBodiesResponse.Unpack
Ref 0cba803fb~1 etc/v1.17.3-full-node

Adapted: the pre-#33835 Unpack returned (txs, uncles, withdrawals) over plain slices; the current one returns (txs, uncles) only (no withdrawals on PoW) and reads body.Transactions.Items()/body.Uncles.Items(), keeping the rlp.RawList BlockBody that #33835 introduced.

3-way merge — purge → getc ← upstream

pre-purge≈ adapted (origin inferred by similarity)fork-only
// Unpack retrieves the transactions and uncles from each block body in the response.
// This is needed for PoW block fetcher which processes bodies differently.
func (p *BlockBodiesResponse) Unpack() ([][]*types.Transaction, [][]*types.Header) {
txset := make([][]*types.Transaction, len(*p))
uncleset := make([][]*types.Header, len(*p))
for i, body := range *p {
txset[i], _ = body.Transactions.Items()
uncleset[i], _ = body.Uncles.Items()
}
return txset, uncleset

← eth Protocol