diff --git a/lib/commands.py b/lib/commands.py index 1987d467..bb10161c 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -656,13 +656,15 @@ class Commands: import urllib.request headers = {'content-type':'application/json'} data = {'address':address, 'status':x.get('result')} + serialized_data = util.to_bytes(json.dumps(data)) try: - req = urllib.request.Request(URL, json.dumps(data), headers) + req = urllib.request.Request(URL, serialized_data, headers) response_stream = urllib.request.urlopen(req, timeout=5) util.print_error('Got Response for %s' % address) except BaseException as e: util.print_error(str(e)) - self.network.send([('blockchain.address.subscribe', [address])], callback) + h = self.network.addr_to_scripthash(address) + self.network.send([('blockchain.scripthash.subscribe', [h])], callback) return True @command('wn')