本文整理汇总了Python中block.Block.self_save方法的典型用法代码示例。如果您正苦于以下问题:Python Block.self_save方法的具体用法?Python Block.self_save怎么用?Python Block.self_save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block.Block
的用法示例。
在下文中一共展示了Block.self_save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validate_possible_block
# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import self_save [as 别名]
def validate_possible_block(possible_block_dict):
possible_block = Block(possible_block_dict)
if possible_block.is_valid():
possible_block.self_save()
#we want to kill and restart the mining block so it knows it lost
sched.print_jobs()
try:
sched.remove_job('mining')
print "removed running mine job in validating possible block"
except apscheduler.jobstores.base.JobLookupError:
print "mining job didn't exist when validating possible block"
print "readding mine for block validating_possible_block"
print sched
print sched.get_jobs()
sched.add_job(mine_for_block, kwargs={'rounds':STANDARD_ROUNDS, 'start_nonce':0}, id='mining') #add the block again
print sched.get_jobs()
return True
return False