Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show First 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | def _test_getblock(self): | ||||
getblockinfo['chainwork'], getblockheaderinfo['chainwork']) | getblockinfo['chainwork'], getblockheaderinfo['chainwork']) | ||||
assert_equal( | assert_equal( | ||||
getblockinfo['previousblockhash'], getblockheaderinfo['previousblockhash']) | getblockinfo['previousblockhash'], getblockheaderinfo['previousblockhash']) | ||||
assert_equal( | assert_equal( | ||||
getblockinfo['nextblockhash'], getblockheaderinfo['nextblockhash']) | getblockinfo['nextblockhash'], getblockheaderinfo['nextblockhash']) | ||||
def _test_waitforblockheight(self): | def _test_waitforblockheight(self): | ||||
self.log.info("Test waitforblockheight") | self.log.info("Test waitforblockheight") | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
# Start a P2P connection since we'll need to create some blocks. | |||||
node.add_p2p_connection(P2PInterface()) | node.add_p2p_connection(P2PInterface()) | ||||
node.p2p.wait_for_verack() | |||||
current_height = node.getblock(node.getbestblockhash())['height'] | current_height = node.getblock(node.getbestblockhash())['height'] | ||||
# Create a fork somewhere below our current height, invalidate the tip | # Create a fork somewhere below our current height, invalidate the tip | ||||
# of that fork, and then ensure that waitforblockheight still | # of that fork, and then ensure that waitforblockheight still | ||||
# works as expected. | # works as expected. | ||||
# | # | ||||
# (Previously this was broken based on setting | # (Previously this was broken based on setting | ||||
Show All 30 Lines |