Skip to content

BlockChainAPI.rpcMarshalHeader

Source (upstream pre-purge) Current
File internal/ethapi/api.go api_pow.go
Symbol BlockChainAPI.rpcMarshalHeader BlockChainAPI.rpcMarshalHeader
Ref 40fd887df~1 etc/v1.17.3-full-node

Wraps RPCMarshalHeader and injects totalDifficulty field.

3-way merge — purge → getc ← upstream

pre-purgefork-only
// rpcMarshalHeader uses the generalized output filler, then adds the total difficulty field, which requires
// a BlockchainAPI.
func (api *BlockChainAPI) rpcMarshalHeader(ctx context.Context, header *types.Header) map[string]interface{} {
fields := RPCMarshalHeader(header)
fields["totalDifficulty"] = (*hexutil.Big)(api.b.GetTd(ctx, header.Hash()))
return fields
}

← RPC & API