diff --git a/electrumx/server/controller.py b/electrumx/server/controller.py index 6c449b6..2a173b9 100644 --- a/electrumx/server/controller.py +++ b/electrumx/server/controller.py @@ -82,8 +82,8 @@ class Controller(ServerBase): '''Start the RPC server and wait for the mempool to synchronize. Then start serving external clients. ''' - if not (0, 15, 0) <= aiorpcx_version < (0, 16): - raise RuntimeError('aiorpcX version 0.15.x is required') + if not (0, 16, 0) <= aiorpcx_version < (0, 17): + raise RuntimeError('aiorpcX version 0.16.x is required') env = self.env min_str, max_str = env.coin.SESSIONCLS.protocol_min_max_strings() diff --git a/electrumx/server/session.py b/electrumx/server/session.py index e375978..45a1839 100644 --- a/electrumx/server/session.py +++ b/electrumx/server/session.py @@ -25,7 +25,7 @@ import attr from aiorpcx import ( RPCSession, JSONRPCAutoDetect, JSONRPCConnection, TaskGroup, handler_invocation, RPCError, Request, sleep, Event, - ExcessiveSessionCostError, FinalRPCError + ExcessiveSessionCostError, ReplyAndDisconnect ) import electrumx @@ -1257,8 +1257,8 @@ class ElectrumX(SessionBase): client_name = str(client_name) if self.env.drop_client is not None and \ self.env.drop_client.match(client_name): - raise FinalRPCError(BAD_REQUEST, - f'unsupported client: {client_name}') + raise ReplyAndDisconnect(RPCError( + BAD_REQUEST, f'unsupported client: {client_name}')) self.client = client_name[:17] # Find the highest common protocol version. Disconnect if @@ -1273,8 +1273,8 @@ class ElectrumX(SessionBase): self.logger.info(f'client requested future protocol version ' f'{util.version_string(client_min)} ' f'- is your software out of date?') - raise FinalRPCError(BAD_REQUEST, - f'unsupported protocol version: {protocol_version}') + raise ReplyAndDisconnect(RPCError( + BAD_REQUEST, f'unsupported protocol version: {protocol_version}')) self.set_request_handlers(ptuple) return (electrumx.version, self.protocol_version_string()) diff --git a/setup.py b/setup.py index 87091cc..7083497 100644 --- a/setup.py +++ b/setup.py @@ -6,8 +6,7 @@ setuptools.setup( version=version, scripts=['electrumx_server', 'electrumx_rpc', 'electrumx_compact_history'], python_requires='>=3.6', - # via environment variables, in which case I've tested with 15.0.4 - install_requires=['aiorpcX>=0.15.0,<0.16', 'attrs', + install_requires=['aiorpcX>=0.16.0,<0.17', 'attrs', 'plyvel', 'pylru', 'aiohttp>=3.3'], extras_require={ 'rocksdb': ['python-rocksdb>=0.6.9'],