Skip to content

internal/ethapi/backend.go

Type MOD
Upstream Lines 129
Changed +1 -0

Add GetTd to the Backend interface so RPC block/header responses can include total difficulty

diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go
index af3d592b8..6783798f1 100644
--- a/internal/ethapi/backend.go
+++ b/internal/ethapi/backend.go
@@ -70,6 +70,7 @@ type Backend interface {
    StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
    Pending() (*types.Block, types.Receipts, *state.StateDB)
    GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
+   GetTd(ctx context.Context, hash common.Hash) *big.Int
    GetCanonicalReceipt(tx *types.Transaction, blockHash common.Hash, blockNumber, blockIndex uint64) (*types.Receipt, error)
    GetEVM(ctx context.Context, state *state.StateDB, header *types.Header, vmConfig *vm.Config, blockCtx *vm.BlockContext) *vm.EVM
    SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription

← Back to RPC & API