[bisq-network/bisq] Json dump for Dao state refactoring (#5608)

Stan notifications at github.com
Wed Sep 22 17:36:23 CEST 2021


@ghubstan commented on this pull request.



> +                })
+                .collect(Collectors.toList());
+
+        ListenableFuture<Void> future = executor.submit(() -> {
+            log.info("Write chainHeight={}, jsonBlockList={}, jsonTxs={}, jsonTxOutputs={}",
+                    chainHeight, jsonBlockList.size(), jsonTxs.size(), jsonTxOutputs.size());
+            chainHeightFileManager.write(String.valueOf(chainHeight), "chainHeight");
+            jsonBlockList.forEach(jsonBlock -> blocksFileManager.write(Utilities.objectToJson(jsonBlock), jsonBlock.getHeight() + "_" + jsonBlock.getHash()));
+            jsonTxs.forEach(jsonTx -> txFileManager.write(Utilities.objectToJson(jsonTx), jsonTx.getId()));
+            jsonTxOutputs.forEach(jsonTxOutput -> txOutputFileManager.write(Utilities.objectToJson(jsonTxOutput), jsonTxOutput.getId()));
+            return null;
+        });
+
+        Futures.addCallback(future, Utilities.failureCallback(throwable -> {
+            log.error(throwable.toString());
+            throwable.printStackTrace();

Isn't this t.printStackTrace() redundant?  You just logged the error, with stack trace.

-- 
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/5608#pullrequestreview-761088063
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210922/f06cec5d/attachment.htm>


More information about the bisq-github mailing list