Browse Source

fix notify command and migrate to use scripthashes

3.1
SomberNight 7 years ago
parent
commit
d808bf057e
  1. 6
      lib/commands.py

6
lib/commands.py

@ -656,13 +656,15 @@ class Commands:
import urllib.request import urllib.request
headers = {'content-type':'application/json'} headers = {'content-type':'application/json'}
data = {'address':address, 'status':x.get('result')} data = {'address':address, 'status':x.get('result')}
serialized_data = util.to_bytes(json.dumps(data))
try: 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) response_stream = urllib.request.urlopen(req, timeout=5)
util.print_error('Got Response for %s' % address) util.print_error('Got Response for %s' % address)
except BaseException as e: except BaseException as e:
util.print_error(str(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 return True
@command('wn') @command('wn')

Loading…
Cancel
Save