Skip to content

Commit b2f7a03

Browse files
m-Peterpeterargue
andauthored
Simplify condition for checking if rate limit is enabled
Co-authored-by: Peter Argue <[email protected]>
1 parent 4e60c99 commit b2f7a03

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

services/requester/requester.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ func (e *EVM) SendRawTransaction(ctx context.Context, data []byte) (common.Hash,
216216
return common.Hash{}, fmt.Errorf("failed to derive the sender: %w", err)
217217
}
218218

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

0 commit comments

Comments
 (0)