Skip to content

Commit 0c2d15d

Browse files
committed
this fixes the test for some reason
1 parent 87c130d commit 0c2d15d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

hathor/p2p/sync_v1/agent.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,14 @@ def handle_get_tips(self, payload: str) -> None:
622622

623623
def send_tips(self, timestamp: Optional[int] = None, include_hashes: bool = False, offset: int = 0) -> None:
624624
"""Try to send a TIPS message. If rate limit has been reached, it schedules to send it later."""
625+
626+
# Filter for active delayed calls once one is executing
627+
self._send_tips_call_later = [
628+
call_later
629+
for call_later in self._send_tips_call_later
630+
if call_later.active()
631+
]
632+
625633
if not self.global_rate_limiter.add_hit(self.GlobalRateLimiter.SEND_TIPS):
626634
self.log.debug('send_tips throttled')
627635
if len(self._send_tips_call_later) >= self._settings.MAX_GET_TIPS_DELAYED_CALLS:
@@ -635,18 +643,12 @@ def send_tips(self, timestamp: Optional[int] = None, include_hashes: bool = Fals
635643
)
636644
)
637645
return
646+
638647
self._send_tips(timestamp, include_hashes, offset)
639648

640649
def _send_tips(self, timestamp: Optional[int] = None, include_hashes: bool = False, offset: int = 0) -> None:
641650
""" Send a TIPS message.
642651
"""
643-
# Filter for active delayed calls once one is executing
644-
self._send_tips_call_later = [
645-
call_later
646-
for call_later in self._send_tips_call_later
647-
if call_later.active()
648-
]
649-
650652
if timestamp is None:
651653
timestamp = self.manager.tx_storage.latest_timestamp
652654

0 commit comments

Comments
 (0)