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 jagdeep sidhu committed Jul 4, 2022
1 parent 31544fb commit 5242202
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ethapi/api.go
Expand Up @@ -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
Expand Down

0 comments on commit 5242202

Please sign in to comment.