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

sqrrm notifications at github.com
Sat Mar 16 17:12:00 UTC 2019

sqrrm commented on this pull request.

My comment on throwing an exception only happened midway through these commits. I still think it can happen but couldn't recreate it.

Everything looks good while running on the current tip. I think it's basically good to go.

> +
+    public void createHashFromBlock(Block block) {
+        updateHashChain(block);
+    }
+    public void requestHashesFromGenesisBlockHeight(String peersAddress) {
+        daoStateNetworkService.requestHashes(genesisTxInfo.getGenesisBlockHeight(), peersAddress);
+    }
+    public void applySnapshot(LinkedList<DaoStateHash> persistedDaoStateHashChain) {
+        // We could got a reset from a reorg, so we clear all and start over from the genesis block.
+        daoStateHashChain.clear();
+        daoStateBlockchain.clear();
+        daoStateNetworkService.reset();
+        log.info("Apply snapshot: Last daoStateHash={}", persistedDaoStateHashChain.getLast());

This throws an exception for an empty persistedDaoStateHashChain.

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/20190316/271586b6/attachment-0001.html>

More information about the bisq-github mailing list