From 7911f0d525a93b59fb4d3055717eeb523a353d29 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Thu, 12 Jul 2018 11:00:57 +0800 Subject: [PATCH] Remove blockchain.address.* methods from protocol 1.3+ --- docs/protocol-changes.rst | 9 +++++++++ electrumx/server/session.py | 17 ++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/protocol-changes.rst b/docs/protocol-changes.rst index fc203e8..f7aa965 100644 --- a/docs/protocol-changes.rst +++ b/docs/protocol-changes.rst @@ -86,6 +86,15 @@ Deprecated methods Version 1.3 =========== +Removed methods +--------------- + + * :func:`blockchain.address.get_balance` + * :func:`blockchain.address.get_history` + * :func:`blockchain.address.get_mempool` + * :func:`blockchain.address.listunspent` + * :func:`blockchain.address.subscribe` + New methods ----------- diff --git a/electrumx/server/session.py b/electrumx/server/session.py index 16e8420..6abbbda 100644 --- a/electrumx/server/session.py +++ b/electrumx/server/session.py @@ -430,11 +430,6 @@ class ElectrumX(SessionBase): controller = self.controller handlers = { - 'blockchain.address.get_balance': controller.address_get_balance, - 'blockchain.address.get_history': controller.address_get_history, - 'blockchain.address.get_mempool': controller.address_get_mempool, - 'blockchain.address.listunspent': controller.address_listunspent, - 'blockchain.address.subscribe': self.address_subscribe, 'blockchain.block.get_chunk': self.block_get_chunk, 'blockchain.block.get_header': controller.block_get_header, 'blockchain.estimatefee': controller.estimatefee, @@ -474,6 +469,18 @@ class ElectrumX(SessionBase): handlers.update({ 'blockchain.block.header': self.block_header, }) + else: + handlers.update({ + 'blockchain.address.get_balance': + controller.address_get_balance, + 'blockchain.address.get_history': + controller.address_get_history, + 'blockchain.address.get_mempool': + controller.address_get_mempool, + 'blockchain.address.listunspent': + controller.address_listunspent, + 'blockchain.address.subscribe': self.address_subscribe, + }) self.electrumx_handlers = handlers