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

sqrrm notifications at github.com
Wed Dec 5 15:16:42 UTC 2018


sqrrm 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) {

Tested a bit and did a 6 block reorg by generating 10 blocks, invalidating the fourth of those blocks and generating 10 more blocks. Results in almost 8200 useless iterations.

It also seems to have broken the phase/cycle handling. Created an issue about it, shouldn't have since it's probably due to the reorg handling, #2064

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


More information about the bisq-github mailing list