@@ -1281,7 +1281,7 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
12811281// RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are
12821282// returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain
12831283// transaction hashes.
1284- func RPCMarshalBlock (block * types.Block , inclTx bool , fullTx bool , config * params.ChainConfig ) map [string ]interface {} {
1284+ func RPCMarshalBlock (block * types.Block , inclTx bool , fullTx bool , config * params.ChainConfig ) ( map [string ]interface {}, error ) {
12851285 fields := RPCMarshalHeader (block .Header ())
12861286 fields ["size" ] = hexutil .Uint64 (block .Size ())
12871287
@@ -1310,7 +1310,7 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param
13101310 if block .Header ().WithdrawalsHash != nil {
13111311 fields ["withdrawals" ] = block .Withdrawals ()
13121312 }
1313- return fields
1313+ return fields , nil
13141314}
13151315
13161316// rpcMarshalHeader uses the generalized output filler, then adds the total difficulty field, which requires
@@ -1324,11 +1324,14 @@ func (s *BlockChainAPI) rpcMarshalHeader(ctx context.Context, header *types.Head
13241324// rpcMarshalBlock uses the generalized output filler, then adds the total difficulty field, which requires
13251325// a `BlockchainAPI`.
13261326func (s * BlockChainAPI ) rpcMarshalBlock (ctx context.Context , b * types.Block , inclTx bool , fullTx bool ) (map [string ]interface {}, error ) {
1327- fields := RPCMarshalBlock (b , inclTx , fullTx , s .b .ChainConfig ())
1327+ fields , err := RPCMarshalBlock (b , inclTx , fullTx , s .b .ChainConfig ())
1328+ if err != nil {
1329+ return nil , err
1330+ }
13281331 if inclTx {
13291332 fields ["totalDifficulty" ] = (* hexutil .Big )(s .b .GetTd (ctx , b .Hash ()))
13301333 }
1331- return fields , nil
1334+ return fields , err
13321335}
13331336
13341337// RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction
0 commit comments