Skip to content

Commit 16eb694

Browse files
committed
fix transaction_args.go
1 parent 7c6e05f commit 16eb694

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/ethapi/transaction_args.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
184184
if args.BlobFeeCap != nil && args.BlobFeeCap.ToInt().Sign() == 0 {
185185
return errors.New("maxFeePerBlobGas, if specified, must be non-zero")
186186
}
187-
if err := args.setCancunFeeDefaults(ctx, head, b); err != nil {
188-
return err
189-
}
190187
// If both gasPrice and at least one of the EIP-1559 fee parameters are specified, error.
191188
if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) {
192189
return errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
@@ -204,7 +201,10 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
204201
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
205202
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
206203
}
207-
return nil // No need to set anything, user already set MaxFeePerGas and MaxPriorityFeePerGas
204+
// No need to set anything other than CancunFeeDefaults, user already set MaxFeePerGas and MaxPriorityFeePerGas
205+
if err := args.setCancunFeeDefaults(ctx, head, b); err != nil {
206+
return err
207+
}
208208
}
209209

210210
// Sanity check the non-EIP-1559 fee parameters.
@@ -260,7 +260,7 @@ func (args *TransactionArgs) setCancunFeeDefaults(ctx context.Context, head *typ
260260
val := new(big.Int).Mul(blobBaseFee, big.NewInt(2))
261261
args.BlobFeeCap = (*hexutil.Big)(val)
262262
}
263-
return nil
263+
return args.setLondonFeeDefaults(ctx, head, b)
264264
}
265265

266266
// setLondonFeeDefaults fills in reasonable default fee values for unspecified fields.

0 commit comments

Comments
 (0)