From c99dd97339e38e57f8c42fb4d360c1430d0de1f6 Mon Sep 17 00:00:00 2001
From: Matt Corallo
Date: Mon, 19 Dec 2016 00:47:08 -0800
Subject: [PATCH] [qa] Avoid race in preciousblock test.
If node 0 is sufficiently fast to announce its block to node 1,
node 1 might already have the block by the time the
node_sync_via_rpc loop gets around to node 1, resulting in the
submitblock result "duplicate-inconclusive" as node 1 has the block,
but prefers an alternate chain.
---
qa/rpc-tests/preciousblock.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qa/rpc-tests/preciousblock.py b/qa/rpc-tests/preciousblock.py
index 3cefa51c0a7f0..0d5f9842e3419 100755
--- a/qa/rpc-tests/preciousblock.py
+++ b/qa/rpc-tests/preciousblock.py
@@ -102,7 +102,7 @@ def run_test(self):
assert_equal(self.nodes[2].getblockcount(), 6)
hashL = self.nodes[2].getbestblockhash()
print("Connect nodes and check no reorg occurs")
- node_sync_via_rpc(self.nodes[0:3])
+ node_sync_via_rpc(self.nodes[1:3])
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,0,2)
assert_equal(self.nodes[0].getbestblockhash(), hashH)