[bisq-network/bisq] Add hash of dao state (#2532)

Manfred Karrer notifications at github.com
Fri Mar 15 02:58:26 UTC 2019

ManfredKarrer commented on this pull request.

> +        // match as well.
+        byte[] combined = ArrayUtils.addAll(prevHash, stateHash);
+        byte[] hash = Hash.getRipemd160hash(combined);
+        DaoStateHash myDaoStateHash = new DaoStateHash(height, hash, prevHash);
+        DaoStateBlock daoStateBlock = new DaoStateBlock(myDaoStateHash);
+        daoStateBlockchain.add(daoStateBlock);
+        listeners.forEach(Listener::onDaoStateBlockchainChanged);
+        log.info("Add daoStateBlock at processNewBlock:\n{}", daoStateBlock);
+        // We only broadcast after parsing of blockchain is complete
+        if (parseBlockChainComplete) {
+            // We delay broadcast to give peers enough time to have received the block.
+            // Otherwise they would ignore our data if received block is in future to their local blockchain.
+            int delayInSec = 1 + new Random().nextInt(5);

Hm.... hard to  say. Prob. its too short. For testing its better ;-). Will will add a TODO to increase it later. 5-10 sec? It is not super critical fi you receive a future block you just drop it.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190314/44675d16/attachment.html>

More information about the bisq-github mailing list