Make sure chainlocks and blocks are propagated in llmq-is-cl-conflicts.py before moving to next steps (#3108)

* Make sure chainlocks and blocks are propagated in llmq-is-cl-conflicts.py before moving to next steps

Add few comments here and there to clarify what's actually going on under the hood

* Simplify
This commit is contained in:
UdjinM6 2019-09-27 21:20:22 +03:00 committed by Alexander Block
parent d6ca9a78ef
commit 22ac6ba4ef

View File

@ -106,19 +106,26 @@ class LLMQ_IS_CL_Conflicts(DashTestFramework):
block = self.create_block(self.nodes[0], [rawtx2_obj])
if test_block_conflict:
# The block shouldn't be accepted/connected but it should be known to node 0 now
submit_result = self.nodes[0].submitblock(ToHex(block))
assert(submit_result == "conflict-tx-lock")
cl = self.create_chainlock(self.nodes[0].getblockcount() + 1, block.sha256)
self.test_node.send_clsig(cl)
self.wait_for_best_chainlock(self.nodes[1], "%064x" % block.sha256)
for node in self.nodes:
self.wait_for_best_chainlock(node, "%064x" % block.sha256)
sync_blocks(self.nodes)
# At this point all nodes should be in sync and have the same "best chainlock"
# The block should get accepted now, and at the same time prune the conflicting ISLOCKs
submit_result = self.nodes[1].submitblock(ToHex(block))
if test_block_conflict:
# Node 1 should receive the block from node 0 and should not accept it again via submitblock
assert(submit_result == "duplicate")
else:
# The block should get accepted now, and at the same time prune the conflicting ISLOCKs
assert(submit_result is None)
for node in self.nodes: