本文整理汇总了Python中jsonrpclib.Server.getlastblockheader方法的典型用法代码示例。如果您正苦于以下问题:Python Server.getlastblockheader方法的具体用法?Python Server.getlastblockheader怎么用?Python Server.getlastblockheader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonrpclib.Server
的用法示例。
在下文中一共展示了Server.getlastblockheader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prettyprint
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import getlastblockheader [as 别名]
if aad["status"] == "OK":
output = []
for line in aad["aliases"]:
output.append([line["alias"], line["address"]])
prettyprint(output)
exit()
# not working
# elif options.aliasinfo:
# print(daemon.get_alias_details({"alias": options.aliasinfo}))
# exit()
output = []
lasthead = daemon.getlastblockheader()["block_header"]
blocks = lasthead["height"]
output.append(["blocks", str(blocks)])
blockreward = lasthead["reward"] * baseunit[options.coin]
output.append(["blockreward", str(blockreward)])
if options.diff > 0:
diff = options.diff
else:
diff = lasthead["difficulty"]
output.append(["difficulty", str(diff)])
md = meandiff(options.coin, diff)
if md > 0: