[bisq-network/bisq] Torrc (#1893)

Manfred Karrer notifications at github.com
Wed Nov 7 18:02:30 UTC 2018


ManfredKarrer commented on this pull request.



> @@ -242,8 +244,21 @@ private void createTorAndHiddenService(File torDir, int localPort, int servicePo
         ListenableFuture<Void> future = executorService.submit(() -> {
             try {
                 long ts1 = new Date().getTime();
+
+                Torrc override = null;
+
+                // check if the user wants to provide his own torrc file
+                String torrcfile = System.getProperty("torrcfile");

I would prefer camelCase as its more readable... torrcfile -> torrcFile. As Torrc comes from a lib it cannot be changed TorRc which I would prefer as well... We use basically camelCase when 2 words are connected. If its a abbreviation liek RC or BTC we use first letter uppercae only -> Rc or Btc, so btcAddress not BTCAddress.

> @@ -257,6 +258,20 @@ private void createTorAndHiddenService(File torDir, int localPort, int servicePo
                     }
                 }
 
+                // check if the user wants to temporarily add to the default torrc file
+                LinkedHashMap<String, String> tmp = new LinkedHashMap<>();
+                System.getProperties().forEach((k, v) -> {
+                    if(((String) k).startsWith("torrc:"))
+                        tmp.put(((String) k).substring(6), (String) v);
+                });
+                if(!tmp.isEmpty())
+                    // check for custom torrcfile
+                    if(null != override)

Why not if(override != null)? I know some devs use that style but not sure the reason. For me its better readable when null is right...

> @@ -249,7 +253,7 @@ private void createTorAndHiddenService(File torDir, int localPort, int servicePo
                 Torrc override = null;
 
                 // check if the user wants to provide his own torrc file
-                String torrcfile = System.getProperty("torrcfile");
+                String torrcfile = System.getProperty(CONFIG_TORRCFILE);

Should we use our program arguments instead of system properties? I am not sure whats better here or if both make sense. Just want to avoid that we mix it as we never use system properties for application specific options so far. But maybe it integrates better with certain environments like with Tails?

-- 
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/1893#pullrequestreview-172618419
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181107/6f5a45f7/attachment-0001.html>


More information about the bisq-github mailing list