@@ -15,6 +15,7 @@ import (
1515 "github.com/ethereum/go-ethereum/core/txpool"
1616 "github.com/ethereum/go-ethereum/core/types"
1717 "github.com/ethereum/go-ethereum/core/vm"
18+ "github.com/ethereum/go-ethereum/internal/ethapi"
1819 "github.com/ethereum/go-ethereum/log"
1920 "github.com/ethereum/go-ethereum/params"
2021 "github.com/ethereum/go-ethereum/rlp"
@@ -93,7 +94,7 @@ func (w *Miner) buildTransactionsLists(
9394 }
9495
9596 return lastTransaction , & PreBuiltTxList {
96- TxList : env .txs ,
97+ TxList : w . toRPCTransactions ( env .txs ) ,
9798 EstimatedGasUsed : env .header .GasLimit - env .gasPool .Gas (),
9899 BytesLength : uint64 (len (b )),
99100 }, nil
@@ -338,6 +339,15 @@ loop:
338339 return lastTransaction
339340}
340341
342+ // toRPCTransactions converts the given transactions to RPC transactions.
343+ func (w * Miner ) toRPCTransactions (txs types.Transactions ) []* ethapi.RPCTransaction {
344+ var rpcTxs []* ethapi.RPCTransaction
345+ for _ , tx := range txs {
346+ rpcTxs = append (rpcTxs , ethapi .NewRPCPendingTransaction (tx , nil , w .chainConfig ))
347+ }
348+ return rpcTxs
349+ }
350+
341351// encodeAndCompressTxList encodes and compresses the given transactions list.
342352func encodeAndCompressTxList (txs types.Transactions ) ([]byte , error ) {
343353 b , err := rlp .EncodeToBytes (txs )
0 commit comments