mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
chore(core): revert []*ethapi.RPCTransaction changes in miner (#394)
This reverts commit afd09afd03.
This commit is contained in:
parent
573f8fc144
commit
03f614fb27
2 changed files with 2 additions and 13 deletions
|
|
@ -6,13 +6,12 @@ import (
|
|||
"github.com/ethereum/go-ethereum/beacon/engine"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/internal/ethapi"
|
||||
)
|
||||
|
||||
// PreBuiltTxList is a pre-built transaction list based on the latest chain state,
|
||||
// with estimated gas used / bytes.
|
||||
type PreBuiltTxList struct {
|
||||
TxList []*ethapi.RPCTransaction
|
||||
TxList types.Transactions
|
||||
EstimatedGasUsed uint64
|
||||
BytesLength uint64
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/txpool"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/internal/ethapi"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
|
|
@ -94,7 +93,7 @@ func (w *Miner) buildTransactionsLists(
|
|||
}
|
||||
|
||||
return lastTransaction, &PreBuiltTxList{
|
||||
TxList: w.toRPCTransactions(env.txs),
|
||||
TxList: env.txs,
|
||||
EstimatedGasUsed: env.header.GasLimit - env.gasPool.Gas(),
|
||||
BytesLength: uint64(len(b)),
|
||||
}, nil
|
||||
|
|
@ -339,15 +338,6 @@ loop:
|
|||
return lastTransaction
|
||||
}
|
||||
|
||||
// toRPCTransactions converts the given transactions to RPC transactions.
|
||||
func (w *Miner) toRPCTransactions(txs types.Transactions) []*ethapi.RPCTransaction {
|
||||
var rpcTxs []*ethapi.RPCTransaction
|
||||
for _, tx := range txs {
|
||||
rpcTxs = append(rpcTxs, ethapi.NewRPCPendingTransaction(tx, nil, w.chainConfig))
|
||||
}
|
||||
return rpcTxs
|
||||
}
|
||||
|
||||
// encodeAndCompressTxList encodes and compresses the given transactions list.
|
||||
func encodeAndCompressTxList(txs types.Transactions) ([]byte, error) {
|
||||
b, err := rlp.EncodeToBytes(txs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue