mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Merge a0791eb175 into 76301ca051
This commit is contained in:
commit
a4cc046ebc
1 changed files with 3 additions and 2 deletions
|
|
@ -132,9 +132,10 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
price := lastPrice
|
price := lastPrice
|
||||||
if len(blockPrices) > 0 {
|
blockPricesSize = len(blockPrices)
|
||||||
|
if blockPricesSize > 0 {
|
||||||
sort.Sort(bigIntArray(blockPrices))
|
sort.Sort(bigIntArray(blockPrices))
|
||||||
price = blockPrices[(len(blockPrices)-1)*gpo.percentile/100]
|
price = blockPrices[(blockPricesSize-1)*gpo.percentile/100]
|
||||||
}
|
}
|
||||||
if price.Cmp(maxPrice) > 0 {
|
if price.Cmp(maxPrice) > 0 {
|
||||||
price = new(big.Int).Set(maxPrice)
|
price = new(big.Int).Set(maxPrice)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue