From f44ec8d93d77ca109abadd9e257a087742007363 Mon Sep 17 00:00:00 2001 From: lightclient <14004106+lightclient@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:58:59 +0200 Subject: [PATCH] internal/ethapi: return chain id for EIP-155 legacy txs (#25155) --- internal/ethapi/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 8bd8ee6fb22f1..89e85d51c189d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1435,6 +1435,11 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber result.TransactionIndex = (*hexutil.Uint64)(&index) } switch tx.Type() { + case types.LegacyTxType: + // if a legacy transaction has an EIP-155 chain id, include it explicitly + if id := tx.ChainId(); id.Sign() == 0 { + result.ChainID = (*hexutil.Big)(id) + } case types.AccessListTxType: al := tx.AccessList() result.Accesses = &al