Skip to content

Commit

Permalink
Wait for full sync in functional tests that use getblocktemplate. (#1642
Browse files Browse the repository at this point in the history
)

The getblocktemplate RPC call fails if used before node is fully synced.
This change fixes extended functional tests that were failing
because of that.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
  • Loading branch information
OlegGirko authored and UdjinM6 committed Sep 20, 2017
1 parent d3829e5 commit 8949f43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions qa/rpc-tests/bip9-softforks.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def get_bip9_status(self, key):


def test_BIP(self, bipName, activated_version, invalidate, invalidatePostSignature, bitno):
wait_to_sync(self.nodes[0])
# generate some coins for later
self.coinbase_blocks = self.nodes[0].generate(2)
self.height = 3 # height of the next block to build
Expand Down
1 change: 1 addition & 0 deletions qa/rpc-tests/getblocktemplate_longpoll.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):

def run_test(self):
print "Warning: this test will take about 70 seconds in the best case. Be patient."
wait_to_sync(self.nodes[0])
self.nodes[0].generate(10)
templat = self.nodes[0].getblocktemplate()
longpollid = templat['longpollid']
Expand Down
1 change: 1 addition & 0 deletions qa/rpc-tests/getblocktemplate_proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework):

def run_test(self):
node = self.nodes[0]
wait_to_sync(node)
node.generate(1) # Mine a block to leave initial block download
tmpl = node.getblocktemplate()
if 'coinbasetxn' not in tmpl:
Expand Down

0 comments on commit 8949f43

Please sign in to comment.