Skip to content

Commit

Permalink
internal/ethapi: fix recover sender of pending transaction (ethereum#…
Browse files Browse the repository at this point in the history
…23765)

* internal/ethapi: fix recover sender of pending transaction

* internal/ethapi: check if current exists
  • Loading branch information
MariusVanDerWijden authored and zzyalbert committed Nov 26, 2021
1 parent 22cb3b9 commit 671690e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1450,10 +1450,12 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
// newRPCPendingTransaction returns a pending transaction that will serialize to the RPC representation
func newRPCPendingTransaction(tx *types.Transaction, current *types.Header, config *params.ChainConfig) *RPCTransaction {
var baseFee *big.Int
blockNumber := uint64(0)
if current != nil {
baseFee = misc.CalcBaseFee(config, current)
blockNumber = current.Number.Uint64()
}
return newRPCTransaction(tx, common.Hash{}, 0, 0, baseFee, config)
return newRPCTransaction(tx, common.Hash{}, blockNumber, 0, baseFee, config)
}

// newRPCTransactionFromBlockIndex returns a transaction that will serialize to the RPC representation.
Expand Down

0 comments on commit 671690e

Please sign in to comment.