[bisq-network/bisq] Dao fix reorg issues (#2056)

Manfred Karrer notifications at github.com
Wed Dec 5 16:57:15 UTC 2018


ManfredKarrer commented on this pull request.



> +
+        try {
+            Block block = blockParser.parseBlock(rawBlock);
+
+            if (pendingBlocks.contains(rawBlock))
+                pendingBlocks.remove(rawBlock);
+
+            // After parsing we check if we have pending blocks we might have received earlier but which have been
+            // not connecting from the latest height we had. The list is sorted by height
+            if (!pendingBlocks.isEmpty()) {
+                // To avoid ConcurrentModificationException we copy the list. It might be altered in the method call
+                ArrayList<RawBlock> tempPendingBlocks = new ArrayList<>(pendingBlocks);
+                for (RawBlock tempPendingBlock : tempPendingBlocks) {
+                    try {
+                        doParseBlock(tempPendingBlock);
+                    } catch (RequiredReorgFromSnapshotException e1) {

Good point about the RequiredReorgFromSnapshotException. I think if we use the first item instead of loop it should be ok. I will look into the other issue. Have not tested how it effect other aspects. We should make a client with all features used (requests, voting, bonds,...) and then apply  a reorg to see if it break anything. Might be valid result if stuff become invalid by deep reorgs - e.g. < break, with < break it should not change results. 

-- 
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/2056#discussion_r239151236
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181205/c1cd60c8/attachment.html>


More information about the bisq-github mailing list