From 115e78c0f52cf265581444d6c3a7994cc4d4cf3c Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Tue, 19 Jul 2022 12:02:04 +0530 Subject: [PATCH] Use geth's eth API on missing blocks for getHeaderByHash --- pkg/eth/api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/eth/api.go b/pkg/eth/api.go index f98d1afd9..eb9c7f20c 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -120,11 +120,10 @@ func (pea *PublicEthAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) } if pea.proxyOnError { - if header, err := pea.ethClient.HeaderByHash(ctx, hash); header != nil && err == nil { + var result map[string]interface{} + if err := pea.rpc.CallContext(ctx, &result, "eth_getHeaderByHash", hash); result != nil && err == nil { go pea.writeStateDiffFor(hash) - if res, err := pea.rpcMarshalHeader(header); err != nil { - return res - } + return result } }