diff --git a/core/tx_pool.go b/core/tx_pool.go index a205e0a008..a49b422614 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -217,8 +217,7 @@ type TxPool struct { signer types.Signer mu sync.RWMutex - homestead bool // Fork indicator whether we are in the homestead stage. - istanbul bool // Fork indicator whether we are in the istanbul stage. + istanbul bool // Fork indicator whether we are in the istanbul stage. currentState *state.StateDB // Current state in the blockchain head pendingNonces *txNoncer // Pending state tracking virtual nonces @@ -543,7 +542,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { return ErrInsufficientFunds } // Ensure the transaction has more gas than the basic tx fee. - intrGas, err := IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead, pool.istanbul) + intrGas, err := IntrinsicGas(tx.Data(), tx.To() == nil, true, pool.istanbul) if err != nil { return err } @@ -1122,14 +1121,9 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) { senderCacher.recover(pool.signer, reinject) pool.addTxsLocked(reinject, false) - // Update all fork indicators by next pending block number. + // Update all fork indicator by next pending block number. next := new(big.Int).Add(newHead.Number, big.NewInt(1)) pool.istanbul = pool.chainconfig.IsIstanbul(next) - if pool.istanbul { - pool.homestead = true - } else { - pool.homestead = pool.chainconfig.IsHomestead(next) - } } // promoteExecutables moves transactions that have become processable from the diff --git a/light/txpool.go b/light/txpool.go index d1c0634afa..11a0e76ae0 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -68,8 +68,7 @@ type TxPool struct { mined map[common.Hash][]*types.Transaction // mined transactions by block hash clearIdx uint64 // earliest block nr that can contain mined tx info - homestead bool // Fork indicator whether we are in the homestead stage. - istanbul bool // Fork indicator whether we are in the istanbul stage. + istanbul bool // Fork indicator whether we are in the istanbul stage. } // TxRelayBackend provides an interface to the mechanism that forwards transacions @@ -312,14 +311,9 @@ func (pool *TxPool) setNewHead(head *types.Header) { m, r := txc.getLists() pool.relay.NewHead(pool.head, m, r) - // Update fork indicators by next pending block number + // Update fork indicator by next pending block number next := new(big.Int).Add(head.Number, big.NewInt(1)) pool.istanbul = pool.config.IsIstanbul(next) - if pool.istanbul { - pool.homestead = true - } else { - pool.homestead = pool.config.IsHomestead(next) - } } // Stop stops the light transaction pool @@ -387,7 +381,7 @@ func (pool *TxPool) validateTx(ctx context.Context, tx *types.Transaction) error } // Should supply enough intrinsic gas - gas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead, pool.istanbul) + gas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, true, pool.istanbul) if err != nil { return err }