Improve proxy initialization (continues #4871) #6272

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2015_06_proxyinit changing 2 files +71 −32
  1. laanwj commented at 7:46 am on June 12, 2015: member

    Make the proxy initialization code in AppInit2 more clear. This provides a straightforward flow, gets rid of .count() (which made it impossible to override an earlier provided proxy option to nothing), as well as comments the different cases.

    This continues the work in #4871. Ping @diapolo.

  2. laanwj added the label P2P on Jun 12, 2015
  3. in src/init.cpp: in 8a0a181c8a outdated
    1024+    std::string onionArg = GetArg("-onion", "");
    1025+    if (onionArg != "") {
    1026+        if (onionArg == "0") { // Handle -noonion/-onion=0
    1027+            SetReachable(NET_TOR, false); // set onions as unreachable
    1028+        } else {
    1029+            proxyType addrOnion;
    


    Diapolo commented at 9:40 am on June 12, 2015:
    Nit: Above you did this as one-liner, so I suggest proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize);

    laanwj commented at 10:07 am on June 12, 2015:
    Good idea.
  4. Diapolo commented at 9:43 am on June 12, 2015: none
    This is a different, but better apporach than what I tried to do. Flow is straight forward, which I really like. I didn’t yet test the code by myself, but from review this is (after fixing the nit) an utACK for now. I’m going to test this now.
  5. laanwj force-pushed on Jun 12, 2015
  6. Improve proxy initialization
    Simplify and make the code in AppInit2 more clear.
    
    This provides a straightforward flow, gets rid of .count() (which makes
    it possible to override an earlier provided proxy option to nothing), as
    well as comments the different cases.
    baf05075fa
  7. laanwj force-pushed on Jun 12, 2015
  8. Diapolo commented at 10:49 am on June 12, 2015: none
    My node connects normally via proxy, the pull compiles without problems, so this has my ACK.
  9. tests: Extend RPC proxy tests
    Also test -noonion
    edbdf8855d
  10. laanwj commented at 12:35 pm on June 16, 2015: member
    Added more proxy tests (these test the output of getnetworkinfo)
  11. laanwj merged this on Jun 18, 2015
  12. laanwj closed this on Jun 18, 2015

  13. laanwj referenced this in commit 40400d53d3 on Jun 18, 2015
  14. zkbot referenced this in commit df07f9ad23 on Feb 15, 2017
  15. zkbot referenced this in commit ec069ce96c on Mar 3, 2017
  16. zkbot referenced this in commit 702eefc71a on Mar 3, 2017
  17. zkbot referenced this in commit 99c4c6de0c on Mar 3, 2017
  18. MarcoFalke locked this on Sep 8, 2021


laanwj Diapolo

Labels
P2P


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-05 16:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me