[bisq-network/bisq] Dao: fix vote reveal tx publishing (#2195)

Manfred Karrer notifications at github.com
Sat Jan 5 15:08:56 UTC 2019


ManfredKarrer commented on this pull request.



> @@ -172,7 +175,13 @@ public void onParseBlockChainComplete() {
     // the blind vote was created in case we have not done it already.
     // The voter need to be at least once online in the reveal phase when he has a blind vote created,
     // otherwise his vote becomes invalid and his locked stake will get unlocked
-    private void maybeRevealVotes(int chainHeight) {
+    private void maybeRevealVotes() {
+        // We must not use daoStateService.getChainHeight() because that gets updated with each parsed block but we
+        // only want to publish the vote reveal tx if our current real chain height is matching the cycle and phase and
+        // not at any intermediate height during parsing all blocks. The bsqNode knows the latest height from either
+        // Bitcoin Core or from the seed node.
+        int chainHeight = bsqNode.getChainTipHeight();

The onNewBlockHeight is called before the parsing of the block. So at the first block of the reveal phase we create and publish the tx. In the next block it will be validated and added to to the DaoState. So we could not wait for parsing until it is not published.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2195#discussion_r245480058
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190105/d7488ca8/attachment.html>


More information about the bisq-github mailing list