mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
eth/gasestimator: fix potential overflow (#32255)
Improve binary search, preventing the potential overflow in certain L2 cases
This commit is contained in:
parent
a7efdcbf09
commit
3b67602c4c
1 changed files with 1 additions and 1 deletions
|
|
@ -170,7 +170,7 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin
|
|||
break
|
||||
}
|
||||
}
|
||||
mid := (hi + lo) / 2
|
||||
mid := lo + (hi-lo)/2
|
||||
if mid > lo*2 {
|
||||
// Most txs don't need much higher gas limit than their gas used, and most txs don't
|
||||
// require near the full block limit of gas, so the selection of where to bisect the
|
||||
|
|
|
|||
Loading…
Reference in a new issue