Skip to content

Commit

Permalink
Merge pull request bitcoin#229 from ptschip/release_bip9softforks
Browse files Browse the repository at this point in the history
Release Branch - Comptool fix for the requestmanager re-request interval
  • Loading branch information
gandrewstone committed Jan 9, 2017
2 parents 0c08202 + 06dd6da commit ee53a14
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions qa/rpc-tests/test_framework/comptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def transaction_requested():
# with the expected outcome (if given)
def check_results(self, blockhash, outcome):
with mininode_lock:

for c in self.connections:
if outcome is None:
if c.cb.bestblockhash != self.connections[0].cb.bestblockhash:
Expand All @@ -267,10 +268,19 @@ def check_results(self, blockhash, outcome):
elif ((c.cb.bestblockhash == blockhash) != outcome):
print("Node ", c.addr, " has best block ", hex(c.cb.bestblockhash), ". Expecting ", hex(blockhash), outcome)
print("Quick RPC returns", c.rpc.getbestblockhash())
time.sleep(5)
time.sleep(5) #wait the requestmanager re-request interval to see if the block shows up
print("Delayed RPC returns", c.rpc.getbestblockhash())

rpcblock = c.rpc.getbestblockhash()
block = hex(blockhash)[2:]
#sometimes a leading zero or two are missing from the blockhash. Replace these.
while (len(block) < 64):
block = '0' + block
if rpcblock == block:
return True
else:
# pdb.set_trace()
return False
return False
return True

# Either check that the mempools all agree with each other, or that
Expand Down

0 comments on commit ee53a14

Please sign in to comment.