Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_dos_header_tree.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2019 The Bitcoin Core developers | # Copyright (c) 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 that we reject low difficulty headers to prevent our block tree from filling up with useless bloat""" | """Test that we reject low difficulty headers to prevent our block tree from filling up with useless bloat""" | ||||
from test_framework.messages import ( | |||||
CBlockHeader, | |||||
FromHex, | |||||
) | |||||
from test_framework.p2p import ( | |||||
P2PInterface, | |||||
msg_headers, | |||||
) | |||||
from test_framework.test_framework import BitcoinTestFramework | |||||
import os | import os | ||||
from test_framework.messages import CBlockHeader, FromHex | |||||
from test_framework.p2p import P2PInterface, msg_headers | |||||
from test_framework.test_framework import BitcoinTestFramework | |||||
class RejectLowDifficultyHeadersTest(BitcoinTestFramework): | class RejectLowDifficultyHeadersTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.chain = 'testnet3' # Use testnet chain because it has an early checkpoint | self.chain = 'testnet3' # Use testnet chain because it has an early checkpoint | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
def add_options(self, parser): | def add_options(self, parser): | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |