From 09c13ee3c70934fe7e18f2347ebc002fb8d772a9 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Thu, 20 Jan 2022 15:57:15 +0530 Subject: [PATCH] fix sender pending txn --- internal/ethapi/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 999e2256cc..a049ff73b2 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1422,10 +1422,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.