Skip to content

Commit 9519dc6

Browse files
m-Peterpeterargue
andcommitted
Simplify condition for checking if rate limit is enabled
Co-authored-by: Peter Argue <[email protected]>
1 parent d9a7c87 commit 9519dc6

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
@@ -211,8 +211,7 @@ func (e *EVM) SendRawTransaction(ctx context.Context, data []byte) (common.Hash,
211211
return common.Hash{}, fmt.Errorf("failed to derive the sender: %w", err)
212212
}
213213

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

0 commit comments

Comments
 (0)