From ebc57346b04b6a9aaef2ad04e099a3fb5d325523 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Wed, 20 Nov 2019 16:26:10 -0600 Subject: [PATCH] simplify calculations in state_transition.go; add guards and derive gasPrice in TxPool.validateTx --- core/chain_makers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/chain_makers.go b/core/chain_makers.go index aa20aa5c8..44537c4f9 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -52,7 +52,7 @@ type BlockGen struct { // SetCoinbase sets the coinbase of the generated block. // It can be called at most once. func (b *BlockGen) SetCoinbase(addr common.Address) { - if b.gasPool != nil || b.gasPool1559 != nil { + if b.gasPool != nil { if len(b.txs) > 0 { panic("coinbase must be set before adding transactions") } @@ -109,7 +109,7 @@ func (b *BlockGen) AddTx(tx *types.Transaction) { // added. If contract code relies on the BLOCKHASH instruction, // the block in chain will be returned. func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) { - if b.gasPool == nil || b.gasPool1559 == nil { + if b.gasPool == nil { b.SetCoinbase(common.Address{}) }