mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-10 12:39:51 +00:00
fix websockets
This commit is contained in:
parent
fa4d7a47f8
commit
8591587f9e
1 changed files with 4 additions and 1 deletions
|
@ -32,6 +32,7 @@ except ImportError:
|
||||||
sys.exit("install SimpleWebSocketServer")
|
sys.exit("install SimpleWebSocketServer")
|
||||||
|
|
||||||
from . import util
|
from . import util
|
||||||
|
from . import bitcoin
|
||||||
|
|
||||||
request_queue = queue.Queue()
|
request_queue = queue.Queue()
|
||||||
|
|
||||||
|
@ -95,14 +96,16 @@ class WsClientThread(util.DaemonThread):
|
||||||
continue
|
continue
|
||||||
util.print_error('response', r)
|
util.print_error('response', r)
|
||||||
method = r.get('method')
|
method = r.get('method')
|
||||||
scripthash = r.get('params')[0]
|
|
||||||
result = r.get('result')
|
result = r.get('result')
|
||||||
if result is None:
|
if result is None:
|
||||||
continue
|
continue
|
||||||
if method == 'blockchain.scripthash.subscribe':
|
if method == 'blockchain.scripthash.subscribe':
|
||||||
|
addr = r.get('params')[0]
|
||||||
|
scripthash = bitcoin.address_to_scripthash(addr)
|
||||||
self.network.get_balance_for_scripthash(
|
self.network.get_balance_for_scripthash(
|
||||||
scripthash, self.response_queue.put)
|
scripthash, self.response_queue.put)
|
||||||
elif method == 'blockchain.scripthash.get_balance':
|
elif method == 'blockchain.scripthash.get_balance':
|
||||||
|
scripthash = r.get('params')[0]
|
||||||
addr = self.network.h2addr.get(scripthash, None)
|
addr = self.network.h2addr.get(scripthash, None)
|
||||||
if addr is None:
|
if addr is None:
|
||||||
util.print_error(
|
util.print_error(
|
||||||
|
|
Loading…
Add table
Reference in a new issue