Skip to content

Commit 5242202

Browse files
lightclientjagdeep sidhu
authored andcommitted
internal/ethapi: return chain id for EIP-155 legacy txs (ethereum#25155)
1 parent 31544fb commit 5242202

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/ethapi/api.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,11 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
12841284
result.TransactionIndex = (*hexutil.Uint64)(&index)
12851285
}
12861286
switch tx.Type() {
1287+
case types.LegacyTxType:
1288+
// if a legacy transaction has an EIP-155 chain id, include it explicitly
1289+
if id := tx.ChainId(); id.Sign() == 0 {
1290+
result.ChainID = (*hexutil.Big)(id)
1291+
}
12871292
case types.AccessListTxType:
12881293
al := tx.AccessList()
12891294
result.Accesses = &al

0 commit comments

Comments
 (0)