mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Merge pull request #430 from thanhson1085/master
set min gas price for tx
This commit is contained in:
commit
09b797bc7f
1 changed files with 7 additions and 0 deletions
|
|
@ -81,6 +81,8 @@ var (
|
||||||
|
|
||||||
ErrZeroGasPrice = errors.New("zero gas price")
|
ErrZeroGasPrice = errors.New("zero gas price")
|
||||||
|
|
||||||
|
ErrUnderMinGasPrice = errors.New("under min gas price")
|
||||||
|
|
||||||
ErrDuplicateSpecialTransaction = errors.New("duplicate a special transaction")
|
ErrDuplicateSpecialTransaction = errors.New("duplicate a special transaction")
|
||||||
|
|
||||||
ErrMinDeploySMC = errors.New("smart contract creation cost is under allowance")
|
ErrMinDeploySMC = errors.New("smart contract creation cost is under allowance")
|
||||||
|
|
@ -621,6 +623,11 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
if tx.GasPrice().Cmp(new(big.Int).SetInt64(0)) == 0 {
|
if tx.GasPrice().Cmp(new(big.Int).SetInt64(0)) == 0 {
|
||||||
return ErrZeroGasPrice
|
return ErrZeroGasPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// under min gas price
|
||||||
|
if tx.GasPrice().Cmp(new(big.Int).SetInt64(common.MinGasPrice)) < 0 {
|
||||||
|
return ErrUnderMinGasPrice
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
minGasDeploySMC := new(big.Int).Mul(new(big.Int).SetUint64(10), new(big.Int).SetUint64(params.Ether))
|
minGasDeploySMC := new(big.Int).Mul(new(big.Int).SetUint64(10), new(big.Int).SetUint64(params.Ether))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue