fix notify command and migrate to use scripthashes

This commit is contained in:
SomberNight 2018-01-16 16:35:29 +01:00
parent 954897c281
commit d808bf057e
1 changed files with 4 additions and 2 deletions

View File

@ -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')