From 11a094ce111ebb591938d1e41d1035531dd5929e Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Thu, 23 Jun 2022 12:08:13 +0200 Subject: [PATCH] internal/ethapi: explicitly return chain id for EIP-155 legacy txs --- internal/ethapi/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7f12fdb95232a..973aa4e7359b3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1283,6 +1283,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