Skip to content

Commit

Permalink
internal/ethapi: return chain id for EIP-155 legacy txs (ethereum#25155)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient authored and cp-wjhan committed Jun 30, 2023
1 parent 9fdb435 commit 146b8cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ethapi/api.go
Expand Up @@ -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
Expand Down

0 comments on commit 146b8cd

Please sign in to comment.