diff --git a/cmd/rpcdaemon/commands/eth_txs.go b/cmd/rpcdaemon/commands/eth_txs.go index 8d99bbb7c..5d1c24069 100644 --- a/cmd/rpcdaemon/commands/eth_txs.go +++ b/cmd/rpcdaemon/commands/eth_txs.go @@ -34,6 +34,17 @@ func (api *APIImpl) GetTransactionByHash(ctx context.Context, txnHash common.Has if err != nil { return nil, err } + // Private API returns 0 if transaction is not found. + if blockNum == 0 && chainConfig.Bor != nil { + blockNumPtr, err := rawdb.ReadBorTxLookupEntry(tx, txnHash) + if err != nil { + return nil, err + } + if blockNumPtr == nil { + return nil, nil + } + blockNum = *blockNumPtr + } if ok { block, err := api.blockByNumberWithSenders(tx, blockNum) if err != nil {