Skip to content

Commit 0eb7527

Browse files
committed
fix minor typos in rate_limits.py
1 parent 4a1a695 commit 0eb7527

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
@@ -83,7 +83,7 @@ def process_msg_and_check(
8383
rate_limits = get_rate_limits_to_use(our_capabilities, peer_capabilities)
8484

8585
try:
86-
limits: RLSettings = rate_limits["default_settings"]
86+
limits: RLSettings
8787
if message_type in rate_limits["rate_limits_tx"]:
8888
limits = rate_limits["rate_limits_tx"][message_type]
8989
elif message_type in rate_limits["rate_limits_other"]:
@@ -113,6 +113,7 @@ def process_msg_and_check(
113113
log.warning(
114114
f"Message type {message_type} not found in rate limits (scale factor: {proportion_of_limit})",
115115
)
116+
limits = rate_limits["default_settings"]
116117

117118
if isinstance(limits, Unlimited):
118119
# this message type is not rate limited. This is used for
@@ -130,9 +131,9 @@ def process_msg_and_check(
130131
if new_message_counts > limits.frequency * proportion_of_limit:
131132
return " ".join(
132133
[
133-
f"message count: {new_message_counts}"
134-
f"> {limits.frequency * proportion_of_limit}"
135-
f"(scale factor: {proportion_of_limit})"
134+
f"message count: {new_message_counts}",
135+
f"> {limits.frequency * proportion_of_limit}",
136+
f"(scale factor: {proportion_of_limit})",
136137
]
137138
)
138139
if len(message.data) > limits.max_size:

0 commit comments

Comments
 (0)