Merge pull request #429 from thanhnguyennguyen/update-min-gas-price

Tomochain: update minGasPrice in SuggestPrice
This commit is contained in:
Tuna 2019-01-31 11:23:23 +07:00 committed by GitHub
commit ee026fc506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,6 @@ import (
) )
var maxPrice = big.NewInt(500 * params.Shannon) var maxPrice = big.NewInt(500 * params.Shannon)
var minPrice = big.NewInt(common.MinGasPrice)
type Config struct { type Config struct {
Blocks int Blocks int
@ -142,8 +141,9 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
} }
// Check gas price min. // Check gas price min.
if price.Cmp(minPrice) < 0 { minGasPrice := big.NewInt(common.MinGasPrice)
price = new(big.Int).Set(minPrice) if price.Cmp(minGasPrice) < 0 {
price = new(big.Int).Set(minGasPrice)
} }
gpo.cacheLock.Lock() gpo.cacheLock.Lock()