Skip to content

Commit

Permalink
internal/ethapi: add back missing check for maxfee < maxPriorityFee (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Aug 23, 2024
1 parent 3b84ef8 commit 53854ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
args.GasPrice = (*hexutil.Big)(price)
}
}
} else {
// Both maxPriorityfee and maxFee set by caller. Sanity-check their internal relation
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
}
}
if args.Value == nil {
args.Value = new(hexutil.Big)
Expand Down

0 comments on commit 53854ef

Please sign in to comment.