announceInterval is for AnnounceThread, not UDPSocket
This commit is contained in:
parent
6168d63699
commit
5f9d507717
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user