From 3e693e1ef6e2da69847a30a14808b327aa07060e 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 b05c9a08d3797..b45c1f123f589 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1284,6 +1284,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