From 388de9649568a06aa709193338856006e1165683 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sun, 3 Nov 2019 14:13:18 +0200 Subject: [PATCH] Alphabetical internal import order in bitmessagemain --- src/bitmessagemain.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 81702783..c70eb0bf 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -7,8 +7,6 @@ # Right now, PyBitmessage only support connecting to stream 1. It doesn't # yet contain logic to expand into further streams. -# The software version variable is now held in shared.py - import os import sys @@ -31,24 +29,23 @@ import time import traceback from struct import pack -from helper_startup import ( - isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections -) -from singleinstance import singleinstance - import defaults import shared -import knownnodes import state import shutdown from bmconfigparser import BMConfigParser from debug import logger # this should go before any threads +from helper_startup import ( + isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections +) from inventory import Inventory +from knownnodes import readKnownNodes # Network objects and threads from network import ( BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread, InvThread, ReceiveQueueThread, DownloadThread, UploadThread) +from singleinstance import singleinstance # Synchronous threads from threads import ( set_thread_name, @@ -72,14 +69,6 @@ def connectToStream(streamNumber): except: pass - with knownnodes.knownNodesLock: - if streamNumber not in knownnodes.knownNodes: - knownnodes.knownNodes[streamNumber] = {} - if streamNumber * 2 not in knownnodes.knownNodes: - knownnodes.knownNodes[streamNumber * 2] = {} - if streamNumber * 2 + 1 not in knownnodes.knownNodes: - knownnodes.knownNodes[streamNumber * 2 + 1] = {} - BMConnectionPool().connectToStream(streamNumber) @@ -279,7 +268,7 @@ class Main: defaults.networkDefaultPayloadLengthExtraBytes = int( defaults.networkDefaultPayloadLengthExtraBytes / 100) - knownnodes.readKnownNodes() + readKnownNodes() # Not needed if objproc is disabled if state.enableObjProc: