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 blakehhuynh committed Oct 3, 2022
1 parent 071ec40 commit d20c72e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
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 d20c72e

Please sign in to comment.