Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show All 36 Lines | from test_framework.blocktools import ( | ||||
create_block, | create_block, | ||||
create_coinbase, | create_coinbase, | ||||
) | ) | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
msg_block, | msg_block, | ||||
) | ) | ||||
from test_framework.mininode import ( | from test_framework.mininode import ( | ||||
P2PInterface, | P2PInterface, | ||||
network_thread_start, | |||||
) | ) | ||||
class BlockchainTest(BitcoinTestFramework): | class BlockchainTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [['-stopatheight=207', '-prune=1']] | self.extra_args = [['-stopatheight=207', '-prune=1']] | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | class BlockchainTest(BitcoinTestFramework): | ||||
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. | # Start a P2P connection since we'll need to create some blocks. | ||||
node.add_p2p_connection(P2PInterface()) | node.add_p2p_connection(P2PInterface()) | ||||
network_thread_start() | |||||
node.p2p.wait_for_verack() | 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. | ||||
# | # | ||||
Show All 31 Lines |