Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_sendheaders.py
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | class SendHeadersTest(BitcoinTestFramework): | ||||
def run_test(self): | def run_test(self): | ||||
# Setup the p2p connections | # Setup the p2p connections | ||||
inv_node = self.nodes[0].add_p2p_connection(BaseNode()) | inv_node = self.nodes[0].add_p2p_connection(BaseNode()) | ||||
# Make sure NODE_NETWORK is not set for test_node, so no block download | # Make sure NODE_NETWORK is not set for test_node, so no block download | ||||
# will occur outside of direct fetching | # will occur outside of direct fetching | ||||
test_node = self.nodes[0].add_p2p_connection(BaseNode(), services=0) | test_node = self.nodes[0].add_p2p_connection(BaseNode(), services=0) | ||||
# Ensure verack's have been processed by our peer | |||||
inv_node.sync_with_ping() | |||||
test_node.sync_with_ping() | |||||
self.test_null_locators(test_node, inv_node) | self.test_null_locators(test_node, inv_node) | ||||
self.test_nonnull_locators(test_node, inv_node) | self.test_nonnull_locators(test_node, inv_node) | ||||
def test_null_locators(self, test_node, inv_node): | def test_null_locators(self, test_node, inv_node): | ||||
tip = self.nodes[0].getblockheader(self.nodes[0].generatetoaddress( | tip = self.nodes[0].getblockheader(self.nodes[0].generatetoaddress( | ||||
1, self.nodes[0].get_deterministic_priv_key().address)[0]) | 1, self.nodes[0].get_deterministic_priv_key().address)[0]) | ||||
tip_hash = int(tip["hash"], 16) | tip_hash = int(tip["hash"], 16) | ||||
▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines |