def bitcoind(self, method, params=[]):
postdata = dumps({"method": method, 'params': params, 'id': 'jsonrpc'})
while True:
try:
respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
except:
print_log("cannot reach martexcoind...")
self.wait_on_bitcoind()
else:
r = loads(respdata)
if r['error'] is not None:
if r['error'].get('code') == -28:
print_log("martexcoind still warming up...")
self.wait_on_bitcoind()
continue
raise BaseException(r['error'])
break
return r.get('result')
blockchain_processor.py 文件源码
python
阅读 99
收藏 0
点赞 0
评论 0
评论列表
文章目录