From 5f9d507717fe3301f610121c98346f50c2f570a2 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 27 Jan 2021 21:46:21 +0200 Subject: [PATCH] announceInterval is for AnnounceThread, not UDPSocket --- src/network/announcethread.py | 4 ++-- src/network/udp.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/network/announcethread.py b/src/network/announcethread.py index 19038ab6..e34ed963 100644 --- a/src/network/announcethread.py +++ b/src/network/announcethread.py @@ -7,7 +7,6 @@ import state from bmconfigparser import BMConfigParser from network.assemble import assemble_addr from network.connectionpool import BMConnectionPool -from network.udp import UDPSocket from node import Peer from threads import StoppableThread @@ -15,12 +14,13 @@ from threads import StoppableThread class AnnounceThread(StoppableThread): """A thread to manage regular announcing of this node""" name = "Announcer" + announceInterval = 60 def run(self): lastSelfAnnounced = 0 while not self._stopped and state.shutdown == 0: processed = 0 - if lastSelfAnnounced < time.time() - UDPSocket.announceInterval: + if lastSelfAnnounced < time.time() - self.announceInterval: self.announceSelf() lastSelfAnnounced = time.time() if processed == 0: diff --git a/src/network/udp.py b/src/network/udp.py index 15804bc9..00e7bfd2 100644 --- a/src/network/udp.py +++ b/src/network/udp.py @@ -18,7 +18,6 @@ logger = logging.getLogger('default') class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes """Bitmessage protocol over UDP (class)""" port = 8444 - announceInterval = 60 def __init__(self, host=None, sock=None, announcing=False): # pylint: disable=bad-super-call