mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
tiny nits to format hexutil.Big and nil properly
This commit is contained in:
parent
ec6a8df988
commit
10d605a1b4
2 changed files with 10 additions and 2 deletions
|
|
@ -414,8 +414,12 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
|
||||||
}
|
}
|
||||||
allowance := new(big.Int).Div(available, call.GasPrice)
|
allowance := new(big.Int).Div(available, call.GasPrice)
|
||||||
if hi > allowance.Uint64() {
|
if hi > allowance.Uint64() {
|
||||||
|
transfer := call.Value
|
||||||
|
if transfer == nil {
|
||||||
|
transfer = new(big.Int)
|
||||||
|
}
|
||||||
log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance,
|
log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance,
|
||||||
"sent", call.Value, "gasprice", call.GasPrice, "fundable", allowance)
|
"sent", transfer, "gasprice", call.GasPrice, "fundable", allowance)
|
||||||
hi = allowance.Uint64()
|
hi = allowance.Uint64()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -937,8 +937,12 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash
|
||||||
}
|
}
|
||||||
allowance := new(big.Int).Div(available, args.GasPrice.ToInt())
|
allowance := new(big.Int).Div(available, args.GasPrice.ToInt())
|
||||||
if hi > allowance.Uint64() {
|
if hi > allowance.Uint64() {
|
||||||
|
transfer := args.Value
|
||||||
|
if transfer == nil {
|
||||||
|
transfer = new(hexutil.Big)
|
||||||
|
}
|
||||||
log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance,
|
log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance,
|
||||||
"sent", args.Value, "gasprice", args.GasPrice, "fundable", allowance)
|
"sent", transfer.ToInt(), "gasprice", args.GasPrice.ToInt(), "fundable", allowance)
|
||||||
hi = allowance.Uint64()
|
hi = allowance.Uint64()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue