Skip to content

Commit 2a451f9

Browse files
authored
Merge pull request #23384 from holiman/fix_gasfoo
internal/ethapi: add back missing check for maxfee < maxPriorityFee
2 parents deff505 + 278ec71 commit 2a451f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/ethapi/transaction_args.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
120120
args.GasPrice = (*hexutil.Big)(price)
121121
}
122122
}
123+
} else {
124+
// Both maxPriorityfee and maxFee set by caller. Sanity-check their internal relation
125+
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
126+
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
127+
}
123128
}
124129
if args.Value == nil {
125130
args.Value = new(hexutil.Big)

0 commit comments

Comments
 (0)