mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Fixed gasprice minimum 2500 for get gasprice api.
Remove check minimum gas price in tx pool.
This commit is contained in:
parent
8914da9097
commit
b749aeeeed
4 changed files with 11 additions and 4 deletions
|
|
@ -14,4 +14,5 @@ const (
|
|||
LimitPenaltyEpoch = 4
|
||||
BlocksPerYear = uint64(15768000)
|
||||
LimitThresholdNonceInQueue = 10
|
||||
MinGasPrice = 2500
|
||||
)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ func BenchmarkAddressHex(b *testing.B) {
|
|||
}
|
||||
|
||||
func TestRemoveItemInArray(t *testing.T) {
|
||||
array := []Address{HexToAddress("0x0000003"),HexToAddress("0x0000001"), HexToAddress("0x0000002"),HexToAddress("0x0000003")}
|
||||
array := []Address{HexToAddress("0x0000003"), HexToAddress("0x0000001"), HexToAddress("0x0000002"), HexToAddress("0x0000003")}
|
||||
remove := []Address{HexToAddress("0x0000002"), HexToAddress("0x0000004"), HexToAddress("0x0000003")}
|
||||
array = RemoveItemFromArray(array, remove)
|
||||
if len(array) != 1 {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import (
|
|||
)
|
||||
|
||||
var maxPrice = big.NewInt(500 * params.Shannon)
|
||||
var minPrice = big.NewInt(common.MinGasPrice)
|
||||
|
||||
type Config struct {
|
||||
Blocks int
|
||||
|
|
@ -140,6 +141,11 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
|||
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.lastHead = headHash
|
||||
gpo.lastPrice = price
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
VersionMajor = 0 // Major version component of the current release
|
||||
VersionMinor = 3 // Minor version component of the current release
|
||||
VersionPatch = 0 // Patch version component of the current release
|
||||
VersionMajor = 0 // Major version component of the current release
|
||||
VersionMinor = 3 // Minor version component of the current release
|
||||
VersionPatch = 0 // Patch version component of the current release
|
||||
VersionMeta = "beta" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue