tfix websockets - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 8591587f9ed9e055edd0205ab45e9412e52c0f63 DIR parent fa4d7a47f8623703f8756254bf166a11cc325ccf HTML Author: SomberNight <somber.night@protonmail.com> Date: Sun, 1 Jul 2018 15:59:32 +0200 fix websockets Diffstat: M lib/websockets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- DIR diff --git a/lib/websockets.py b/lib/websockets.py t@@ -32,6 +32,7 @@ except ImportError: sys.exit("install SimpleWebSocketServer") from . import util +from . import bitcoin request_queue = queue.Queue() t@@ -95,14 +96,16 @@ class WsClientThread(util.DaemonThread): continue util.print_error('response', r) method = r.get('method') - scripthash = r.get('params')[0] result = r.get('result') if result is None: continue if method == 'blockchain.scripthash.subscribe': + addr = r.get('params')[0] + scripthash = bitcoin.address_to_scripthash(addr) self.network.get_balance_for_scripthash( scripthash, self.response_queue.put) elif method == 'blockchain.scripthash.get_balance': + scripthash = r.get('params')[0] addr = self.network.h2addr.get(scripthash, None) if addr is None: util.print_error(