mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
simplification
This commit is contained in:
parent
6403291ba4
commit
c14d3318a7
1 changed files with 7 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ type environment struct {
|
|||
signer types.Signer
|
||||
state *state.StateDB // apply state changes here
|
||||
tcount int // tx count in cycle
|
||||
size uint64 // size of the block we are building
|
||||
gasPool *core.GasPool // available gas used to pack transactions
|
||||
coinbase common.Address
|
||||
evm *vm.EVM
|
||||
|
|
@ -265,6 +266,7 @@ func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase
|
|||
return &environment{
|
||||
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
|
||||
state: state,
|
||||
size: uint64(header.Size()),
|
||||
coinbase: coinbase,
|
||||
header: header,
|
||||
witness: state.Witness(),
|
||||
|
|
@ -282,6 +284,7 @@ func (miner *Miner) commitTransaction(env *environment, tx *types.Transaction) e
|
|||
}
|
||||
env.txs = append(env.txs, tx)
|
||||
env.receipts = append(env.receipts, receipt)
|
||||
env.size += tx.Size()
|
||||
env.tcount++
|
||||
return nil
|
||||
}
|
||||
|
|
@ -400,6 +403,10 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
|
|||
continue
|
||||
}
|
||||
|
||||
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) && env.size+tx.Size() > params.BlockRLPSizeCap {
|
||||
break
|
||||
}
|
||||
|
||||
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) && env.encodedSizeWithTx(tx) > params.BlockRLPSizeCap {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue