Use DNS seed only if knownnodes are empty #1325

Merged
g1itch merged 1 commits from dns into v0.6 2018-08-02 11:23:37 +02:00

View File

@ -8,6 +8,7 @@ import re
from bmconfigparser import BMConfigParser from bmconfigparser import BMConfigParser
from debug import logger from debug import logger
import helper_bootstrap import helper_bootstrap
from knownnodes import knownNodes
from network.proxy import Proxy from network.proxy import Proxy
from network.tcp import TCPServer, Socks5BMConnection, Socks4aBMConnection, TCPConnection from network.tcp import TCPServer, Socks5BMConnection, Socks4aBMConnection, TCPConnection
from network.udp import UDPSocket from network.udp import UDPSocket
@ -138,8 +139,9 @@ class BMConnectionPool(object):
acceptConnections = False acceptConnections = False
if spawnConnections: if spawnConnections:
if not self.bootstrapped: if not any([knownNodes.iteritems()]):
helper_bootstrap.dns() helper_bootstrap.dns()
if not self.bootstrapped:
self.bootstrapped = True self.bootstrapped = True
Proxy.proxy = (BMConfigParser().safeGet("bitmessagesettings", "sockshostname"), Proxy.proxy = (BMConfigParser().safeGet("bitmessagesettings", "sockshostname"),
BMConfigParser().safeGetInt("bitmessagesettings", "socksport")) BMConfigParser().safeGetInt("bitmessagesettings", "socksport"))