Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115158
D17713.id52806.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D17713.id52806.diff
View Options
diff --git a/test/functional/feature_assumevalid.py b/test/functional/feature_assumevalid.py
--- a/test/functional/feature_assumevalid.py
+++ b/test/functional/feature_assumevalid.py
@@ -149,10 +149,21 @@
self.start_node(1, extra_args=[f"-assumevalid={hex(block102.sha256)}"])
self.start_node(2, extra_args=[f"-assumevalid={hex(block102.sha256)}"])
+ def wait_for_header_sync(node, height):
+ expected = {
+ "height": height,
+ "hash": self.blocks[height - 1].hash,
+ "branchlen": height,
+ "status": "headers-only",
+ }
+ self.wait_until(lambda: expected in node.getchaintips())
+
p2p0 = self.nodes[0].add_p2p_connection(BaseNode())
p2p0.send_header_for_blocks(self.blocks[0:2000])
p2p0.send_header_for_blocks(self.blocks[2000:])
+ wait_for_header_sync(self.nodes[0], 2202)
+
# Send blocks to node0. Block 102 will be rejected.
self.send_blocks_until_disconnected(p2p0)
self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1)
@@ -162,6 +173,8 @@
p2p1.send_header_for_blocks(self.blocks[0:2000])
p2p1.send_header_for_blocks(self.blocks[2000:])
+ wait_for_header_sync(self.nodes[1], 2202)
+
# Send all blocks to node1. All blocks will be accepted.
for i in range(2202):
p2p1.send_message(msg_block(self.blocks[i]))
@@ -175,6 +188,8 @@
p2p2 = self.nodes[2].add_p2p_connection(BaseNode())
p2p2.send_header_for_blocks(self.blocks[0:200])
+ wait_for_header_sync(self.nodes[2], 200)
+
# Send blocks to node2. Block 102 will be rejected.
self.send_blocks_until_disconnected(p2p2)
self.wait_until(lambda: self.nodes[2].getblockcount() >= COINBASE_MATURITY + 1)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 10:02 (7 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5182634
Default Alt Text
D17713.id52806.diff (1 KB)
Attached To
D17713: Prevent occasional timeout in feature_assumevalid
Event Timeline
Log In to Comment