internal/ethapi, graphql: correct comments about gas price logic (#27752)

This commit is contained in:
Christopher Harrison
2023-08-05 01:08:53 +02:00
committed by GitHub
parent 5c30541c2a
commit 60070fe5c6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ func (t *Transaction) GasPrice(ctx context.Context) hexutil.Big {
case types.DynamicFeeTxType:
if block != nil {
if baseFee, _ := block.BaseFeePerGas(ctx); baseFee != nil {
// price = min(tip, gasFeeCap - baseFee) + baseFee
// price = min(gasTipCap + baseFee, gasFeeCap)
return (hexutil.Big)(*math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee.ToInt()), tx.GasFeeCap()))
}
}