@@ -78,7 +78,7 @@ def process_msg_and_check(
78
78
rate_limits = get_rate_limits_to_use (our_capabilities , peer_capabilities )
79
79
80
80
try :
81
- limits : RLSettings = rate_limits [ "default_settings" ]
81
+ limits : RLSettings
82
82
if message_type in rate_limits ["rate_limits_tx" ]:
83
83
limits = rate_limits ["rate_limits_tx" ][message_type ]
84
84
elif message_type in rate_limits ["rate_limits_other" ]:
@@ -108,6 +108,7 @@ def process_msg_and_check(
108
108
log .warning (
109
109
f"Message type { message_type } not found in rate limits (scale factor: { proportion_of_limit } )" ,
110
110
)
111
+ limits = rate_limits ["default_settings" ]
111
112
112
113
if isinstance (limits , Unlimited ):
113
114
# this message type is not rate limited. This is used for
@@ -125,9 +126,9 @@ def process_msg_and_check(
125
126
if new_message_counts > limits .frequency * proportion_of_limit :
126
127
return " " .join (
127
128
[
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 } )" ,
131
132
]
132
133
)
133
134
if len (message .data ) > limits .max_size :
0 commit comments