Skip to content

Commit

Permalink
Simplify condition for checking if rate limit is enabled
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Argue <[email protected]>
  • Loading branch information
m-Peter and peterargue authored Feb 24, 2025
1 parent 4e60c99 commit b2f7a03
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions services/requester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ func (e *EVM) SendRawTransaction(ctx context.Context, data []byte) (common.Hash,
return common.Hash{}, fmt.Errorf("failed to derive the sender: %w", err)
}

rateLimitEnabled := e.config.TxRequestLimit > 0
if rateLimitEnabled {
if e.config.TxRequestLimit > 0 {
_, _, _, ok, err := e.limiter.Take(ctx, from.Hex())
if err != nil {
return common.Hash{}, fmt.Errorf("failed to check rate limit: %w", err)
Expand Down

0 comments on commit b2f7a03

Please sign in to comment.