mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-23 00:09:26 +00:00
graphql: handle missing block body in Raw resolver (#35027)
Return empty raw bytes when the GraphQL `Block.raw` resolver cannot load the block body. This matches the nil handling used by the other block-body-backed resolvers and avoids exposing RLP empty-list bytes as raw block data.
This commit is contained in:
parent
a059a357d1
commit
d3edc58ef7
1 changed files with 1 additions and 1 deletions
|
|
@ -929,7 +929,7 @@ func (b *Block) RawHeader(ctx context.Context) (hexutil.Bytes, error) {
|
||||||
|
|
||||||
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) {
|
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) {
|
||||||
block, err := b.resolve(ctx)
|
block, err := b.resolve(ctx)
|
||||||
if err != nil {
|
if err != nil || block == nil {
|
||||||
return hexutil.Bytes{}, err
|
return hexutil.Bytes{}, err
|
||||||
}
|
}
|
||||||
return rlp.EncodeToBytes(block)
|
return rlp.EncodeToBytes(block)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue