Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_preciousblock.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2019 The Bitcoin Core developers | # Copyright (c) 2015-2019 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the preciousblock RPC.""" | """Test the preciousblock RPC.""" | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import assert_equal, connect_nodes | ||||
assert_equal, | |||||
connect_nodes, | |||||
) | |||||
def unidirectional_node_sync_via_rpc(node_src, node_dest): | def unidirectional_node_sync_via_rpc(node_src, node_dest): | ||||
blocks_to_copy = [] | blocks_to_copy = [] | ||||
blockhash = node_src.getbestblockhash() | blockhash = node_src.getbestblockhash() | ||||
while True: | while True: | ||||
try: | try: | ||||
assert len(node_dest.getblock(blockhash, False)) > 0 | assert len(node_dest.getblock(blockhash, False)) > 0 | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |