Use new Session interface
This commit is contained in:
parent
2d66a4f5aa
commit
9c5d59e997
@ -20,8 +20,8 @@ from collections import defaultdict
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from aiorpcx import (
|
from aiorpcx import (
|
||||||
ServerSession, JSONRPCAutoDetect, TaskGroup, handler_invocation,
|
ServerSession, JSONRPCAutoDetect, JSONRPCConnection,
|
||||||
RPCError, Request, ignore_after
|
TaskGroup, handler_invocation, RPCError, Request, ignore_after
|
||||||
)
|
)
|
||||||
|
|
||||||
import electrumx
|
import electrumx
|
||||||
@ -506,7 +506,8 @@ class SessionBase(ServerSession):
|
|||||||
session_counter = itertools.count()
|
session_counter = itertools.count()
|
||||||
|
|
||||||
def __init__(self, session_mgr, chain_state, mempool, peer_mgr, kind):
|
def __init__(self, session_mgr, chain_state, mempool, peer_mgr, kind):
|
||||||
super().__init__(protocol=JSONRPCAutoDetect)
|
connection = JSONRPCConnection(JSONRPCAutoDetect)
|
||||||
|
super().__init__(connection=connection)
|
||||||
self.logger = util.class_logger(__name__, self.__class__.__name__)
|
self.logger = util.class_logger(__name__, self.__class__.__name__)
|
||||||
self.session_mgr = session_mgr
|
self.session_mgr = session_mgr
|
||||||
self.chain_state = chain_state
|
self.chain_state = chain_state
|
||||||
@ -610,7 +611,7 @@ class ElectrumX(SessionBase):
|
|||||||
self.subscribe_headers = False
|
self.subscribe_headers = False
|
||||||
self.subscribe_headers_raw = False
|
self.subscribe_headers_raw = False
|
||||||
self.notified_height = None
|
self.notified_height = None
|
||||||
self.connection._max_response_size = self.env.max_send
|
self.connection.max_response_size = self.env.max_send
|
||||||
self.max_subs = self.env.max_session_subs
|
self.max_subs = self.env.max_session_subs
|
||||||
self.hashX_subs = {}
|
self.hashX_subs = {}
|
||||||
self.sv_seen = False
|
self.sv_seen = False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user