Skip to content

Commit

Permalink
announceInterval is for AnnounceThread, not UDPSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed Feb 22, 2021
1 parent 6168d63 commit 5f9d507
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/network/announcethread.py
Expand Up @@ -7,20 +7,20 @@
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


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:
Expand Down
1 change: 0 additions & 1 deletion src/network/udp.py
Expand Up @@ -18,7 +18,6 @@
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
Expand Down

0 comments on commit 5f9d507

Please sign in to comment.