v29.4-roots.1 · Commit 3: [PATCH 03/13] policy: restore conservative relay and network controls
test/functional/p2p_unrequested_blocks.py
Before: test/functional/p2p_unrequested_blocks.py · After: test/functional/p2p_unrequested_blocks.py
File metadata
index 1430131a97cb5bd4d5df279376d4e483aa145f85..9c5ebe29fd311d81ef85e3c6b67a8cd6eac9376c 100755
Download original patch · Release notes
Diff rows 1–24 of 24. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
test/functional/p2p_unrequested_blocks.py
CHANGED
|
@@ -80,7 +80,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
|
| 80 |
return False
|
| 81 |
|
| 82 |
def run_test(self):
|
| 83 |
-
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
| 84 |
min_work_node = self.nodes[1].add_p2p_connection(P2PInterface())
|
| 85 |
|
| 86 |
# 1. Have nodes mine a block (leave IBD)
|
|
@@ -203,7 +203,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
|
| 203 |
self.nodes[0].disconnect_p2ps()
|
| 204 |
self.nodes[1].disconnect_p2ps()
|
| 205 |
|
| 206 |
-
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
| 207 |
|
| 208 |
test_node.send_and_ping(msg_block(block_h1f))
|
| 209 |
assert_equal(self.nodes[0].getblockcount(), 2)
|
|
@@ -275,7 +275,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
|
| 275 |
test_node.wait_for_disconnect()
|
| 276 |
|
| 277 |
self.nodes[0].disconnect_p2ps()
|
| 278 |
-
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
| 279 |
|
| 280 |
# We should have failed reorg and switched back to 290 (but have block 291)
|
| 281 |
assert_equal(self.nodes[0].getblockcount(), 290)
|
|
|
|
| 80 |
return False
|
| 81 |
|
| 82 |
def run_test(self):
|
| 83 |
+
test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=0)
|
| 84 |
min_work_node = self.nodes[1].add_p2p_connection(P2PInterface())
|
| 85 |
|
| 86 |
# 1. Have nodes mine a block (leave IBD)
|
|
|
|
| 203 |
self.nodes[0].disconnect_p2ps()
|
| 204 |
self.nodes[1].disconnect_p2ps()
|
| 205 |
|
| 206 |
+
test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=2)
|
| 207 |
|
| 208 |
test_node.send_and_ping(msg_block(block_h1f))
|
| 209 |
assert_equal(self.nodes[0].getblockcount(), 2)
|
|
|
|
| 275 |
test_node.wait_for_disconnect()
|
| 276 |
|
| 277 |
self.nodes[0].disconnect_p2ps()
|
| 278 |
+
test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=3)
|
| 279 |
|
| 280 |
# We should have failed reorg and switched back to 290 (but have block 291)
|
| 281 |
assert_equal(self.nodes[0].getblockcount(), 290)
|