mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
change EstimateGas from pending block to latest block
This commit is contained in:
parent
38d7c2c707
commit
15c5f76c39
1 changed files with 2 additions and 2 deletions
|
|
@ -695,7 +695,7 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
hi = uint64(args.Gas)
|
||||
} else {
|
||||
// Retrieve the current pending block to act as the gas ceiling
|
||||
block, err := s.b.BlockByNumber(ctx, rpc.PendingBlockNumber)
|
||||
block, err := s.b.BlockByNumber(ctx, rpc.LatestBlockNumber)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
@ -707,7 +707,7 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
executable := func(gas uint64) bool {
|
||||
args.Gas = hexutil.Uint64(gas)
|
||||
|
||||
_, _, failed, err := s.doCall(ctx, args, rpc.PendingBlockNumber, vm.Config{}, 0)
|
||||
_, _, failed, err := s.doCall(ctx, args, rpc.LatestBlockNumber, vm.Config{}, 0)
|
||||
if err != nil || failed {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue