Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_unrequested_blocks.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-2016 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. | ||||
import os | |||||
import time | import time | ||||
from test_framework.blocktools import ( | from test_framework.blocktools import ( | ||||
create_block, | create_block, | ||||
create_coinbase, | create_coinbase, | ||||
create_transaction, | create_transaction, | ||||
) | ) | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
9. Test Node1 is able to sync when connected to node0 (which should have sufficient | 9. Test Node1 is able to sync when connected to node0 (which should have sufficient | ||||
work on its chain). | work on its chain). | ||||
''' | ''' | ||||
class AcceptBlockTest(BitcoinTestFramework): | class AcceptBlockTest(BitcoinTestFramework): | ||||
def add_options(self, parser): | |||||
parser.add_argument("--testbinary", dest="testbinary", | |||||
default=os.getenv("BITCOIND", "bitcoind"), | |||||
help="bitcoind binary to test") | |||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.extra_args = [["-noparkdeepreorg"], | self.extra_args = [["-noparkdeepreorg"], | ||||
["-minimumchainwork=0x10"]] | ["-minimumchainwork=0x10"]] | ||||
def setup_network(self): | def setup_network(self): | ||||
# Node0 will be used to test behavior of processing unrequested blocks | # Node0 will be used to test behavior of processing unrequested blocks | ||||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |