Minor tweaks
This commit is contained in:
parent
f5926cf865
commit
7ce91b1a43
@ -6,6 +6,7 @@
|
|||||||
# and warranty status of this software.
|
# and warranty status of this software.
|
||||||
|
|
||||||
from aiorpcx import _version as aiorpcx_version
|
from aiorpcx import _version as aiorpcx_version
|
||||||
|
|
||||||
import electrumx
|
import electrumx
|
||||||
from electrumx.lib.server_base import ServerBase
|
from electrumx.lib.server_base import ServerBase
|
||||||
from electrumx.lib.tasks import Tasks
|
from electrumx.lib.tasks import Tasks
|
||||||
@ -38,8 +39,6 @@ class Controller(ServerBase):
|
|||||||
self.logger.info(f'supported protocol versions: {min_str}-{max_str}')
|
self.logger.info(f'supported protocol versions: {min_str}-{max_str}')
|
||||||
self.logger.info(f'event loop policy: {env.loop_policy}')
|
self.logger.info(f'event loop policy: {env.loop_policy}')
|
||||||
|
|
||||||
env.max_send = max(350000, env.max_send)
|
|
||||||
|
|
||||||
self.tasks = Tasks()
|
self.tasks = Tasks()
|
||||||
self.chain_state = ChainState(env, self.tasks, self.shutdown_event)
|
self.chain_state = ChainState(env, self.tasks, self.shutdown_event)
|
||||||
self.peer_mgr = PeerManager(env, self.tasks, self.chain_state)
|
self.peer_mgr = PeerManager(env, self.tasks, self.chain_state)
|
||||||
|
|||||||
@ -98,6 +98,7 @@ class SessionManager(object):
|
|||||||
CATCHING_UP, LISTENING, PAUSED, SHUTTING_DOWN = range(4)
|
CATCHING_UP, LISTENING, PAUSED, SHUTTING_DOWN = range(4)
|
||||||
|
|
||||||
def __init__(self, env, tasks, chain_state, peer_mgr):
|
def __init__(self, env, tasks, chain_state, peer_mgr):
|
||||||
|
env.max_send = max(350000, env.max_send)
|
||||||
self.env = env
|
self.env = env
|
||||||
self.tasks = tasks
|
self.tasks = tasks
|
||||||
self.chain_state = chain_state
|
self.chain_state = chain_state
|
||||||
@ -713,8 +714,7 @@ class ElectrumX(SessionBase):
|
|||||||
|
|
||||||
async def add_peer(self, features):
|
async def add_peer(self, features):
|
||||||
'''Add a peer (but only if the peer resolves to the source).'''
|
'''Add a peer (but only if the peer resolves to the source).'''
|
||||||
peer_mgr = self.peer_mgr
|
return await self.peer_mgr.on_add_peer(features, self.peer_address())
|
||||||
return await peer_mgr.on_add_peer(features, self.peer_address())
|
|
||||||
|
|
||||||
def peers_subscribe(self):
|
def peers_subscribe(self):
|
||||||
'''Return the server peers as a list of (ip, host, details) tuples.'''
|
'''Return the server peers as a list of (ip, host, details) tuples.'''
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user