提交 7f68e08f 编写于 作者: B Brian Johnson

Fixed magic number for pull request changes and minor cleanup. GH #3835

上级 0aebdf02
......@@ -302,7 +302,8 @@ class Node(object):
assert(transId)
assert(isinstance(transId, str))
trans=self.getTransaction(transId)
assert(trans)
if trans is None:
return None
refBlockNum=None
key=""
......@@ -549,6 +550,7 @@ class Node(object):
def waitForTransInBlock(self, transId, timeout=None):
"""Wait for trans id to be finalized."""
assert(isinstance(transId, str))
lam = lambda: self.isTransInAnyBlock(transId)
ret=Utils.waitForBool(lam, timeout)
return ret
......
......@@ -69,12 +69,15 @@ def validBlockProducer(prodsActive, prodsSeen, blockNum, node):
def getNextCleanProductionCycle(trans, node):
transId=Node.getTransId(trans)
rounds=15*12*2 # 2/3+1 of producers x blocks per producer x at least 2 times
rounds=21*12*2 # max time to ensure that at least 2/3+1 of producers x blocks per producer x at least 2 times
node.waitForTransFinalization(transId, timeout=rounds/2)
irreversibleBlockNum=node.getIrreversibleBlockNum()
# The voted schedule should be promoted now, then need to wait for that to become irreversible
promotedBlockNum=node.getHeadBlockNum()+240
# The voted schedule should be promoted now, then need to wait for that to become irreversible
votingTallyWindow=120 #could be up to 120 blocks before the votes were tallied
promotedBlockNum=node.getHeadBlockNum()+votingTallyWindow
node.waitForIrreversibleBlock(promotedBlockNum, timeout=rounds/2)
ibnSchedActive=node.getIrreversibleBlockNum()
blockNum=node.getHeadBlockNum()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册