From 845d3d49e530fe86838e939a7fa6be99bd127972 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Mon, 17 Jul 2023 18:19:56 +0800 Subject: [PATCH] change minGasPrice in function validateTx --- core/tx_pool.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index abb55e4948..d7a97ee1c2 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -632,7 +632,11 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { // cost == V + GP * GL balance := pool.currentState.GetBalance(from) cost := tx.Cost() - minGasPrice := common.MinGasPrice + var number *big.Int = nil + if pool.chain.CurrentHeader() != nil { + number = pool.chain.CurrentHeader().Number + } + minGasPrice := common.GetMinGasPrice(number) feeCapacity := big.NewInt(0) if tx.To() != nil {