Skip to content

Commit 3adfde1

Browse files
committed
fix minor typos in rate_limits.py
1 parent 1fc4a70 commit 3adfde1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

chia/server/rate_limits.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def process_msg_and_check(
7878
rate_limits = get_rate_limits_to_use(our_capabilities, peer_capabilities)
7979

8080
try:
81-
limits: RLSettings = rate_limits["default_settings"]
81+
limits: RLSettings
8282
if message_type in rate_limits["rate_limits_tx"]:
8383
limits = rate_limits["rate_limits_tx"][message_type]
8484
elif message_type in rate_limits["rate_limits_other"]:
@@ -108,6 +108,7 @@ def process_msg_and_check(
108108
log.warning(
109109
f"Message type {message_type} not found in rate limits (scale factor: {proportion_of_limit})",
110110
)
111+
limits = rate_limits["default_settings"]
111112

112113
if isinstance(limits, Unlimited):
113114
# this message type is not rate limited. This is used for
@@ -125,9 +126,9 @@ def process_msg_and_check(
125126
if new_message_counts > limits.frequency * proportion_of_limit:
126127
return " ".join(
127128
[
128-
f"message count: {new_message_counts}"
129-
f"> {limits.frequency * proportion_of_limit}"
130-
f"(scale factor: {proportion_of_limit})"
129+
f"message count: {new_message_counts}",
130+
f"> {limits.frequency * proportion_of_limit}",
131+
f"(scale factor: {proportion_of_limit})",
131132
]
132133
)
133134
if len(message.data) > limits.max_size:

0 commit comments

Comments
 (0)