mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
Fixed gasprice minimum 2500 for get gasprice api.
This commit is contained in:
parent
bbadba469b
commit
d3fc7da872
2 changed files with 21 additions and 13 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
package common
|
package common
|
||||||
|
|
||||||
const (
|
const (
|
||||||
RewardMasterPercent = 40
|
RewardMasterPercent = 40
|
||||||
RewardVoterPercent = 50
|
RewardVoterPercent = 50
|
||||||
RewardFoundationPercent = 10
|
RewardFoundationPercent = 10
|
||||||
HexSignMethod = "e341eaa4"
|
HexSignMethod = "e341eaa4"
|
||||||
HexSetSecret = "34d38600"
|
HexSetSecret = "34d38600"
|
||||||
HexSetOpening = "e11f5ba2"
|
HexSetOpening = "e11f5ba2"
|
||||||
EpocBlockSecret = 800
|
EpocBlockSecret = 800
|
||||||
EpocBlockOpening = 850
|
EpocBlockOpening = 850
|
||||||
EpocBlockRandomize = 900
|
EpocBlockRandomize = 900
|
||||||
MaxMasternodes = 150
|
MaxMasternodes = 150
|
||||||
LimitPenaltyEpoch = 4
|
LimitPenaltyEpoch = 4
|
||||||
BlocksPerYear = uint64(15768000)
|
BlocksPerYear = uint64(15768000)
|
||||||
|
LimitThresholdNonceInQueue = 10
|
||||||
|
MinGasPrice = 2500
|
||||||
)
|
)
|
||||||
|
|
@ -30,6 +30,7 @@ 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
|
||||||
|
|
@ -140,6 +141,11 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
||||||
price = new(big.Int).Set(maxPrice)
|
price = new(big.Int).Set(maxPrice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check gas price min.
|
||||||
|
if price.Cmp(minPrice) < 0 {
|
||||||
|
price = new(big.Int).Set(minPrice)
|
||||||
|
}
|
||||||
|
|
||||||
gpo.cacheLock.Lock()
|
gpo.cacheLock.Lock()
|
||||||
gpo.lastHead = headHash
|
gpo.lastHead = headHash
|
||||||
gpo.lastPrice = price
|
gpo.lastPrice = price
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue