Skip to content

Commit 433f091

Browse files
internal/ethapi: fix recover sender of pending transaction (#23765)
* internal/ethapi: fix recover sender of pending transaction * internal/ethapi: check if current exists
1 parent b8dc1e2 commit 433f091

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/ethapi/api.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,10 +1334,12 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
13341334
// newRPCPendingTransaction returns a pending transaction that will serialize to the RPC representation
13351335
func newRPCPendingTransaction(tx *types.Transaction, current *types.Header, config *params.ChainConfig) *RPCTransaction {
13361336
var baseFee *big.Int
1337+
blockNumber := uint64(0)
13371338
if current != nil {
13381339
baseFee = misc.CalcBaseFee(config, current)
1340+
blockNumber = current.Number.Uint64()
13391341
}
1340-
return newRPCTransaction(tx, common.Hash{}, 0, 0, baseFee, config)
1342+
return newRPCTransaction(tx, common.Hash{}, blockNumber, 0, baseFee, config)
13411343
}
13421344

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

0 commit comments

Comments
 (0)