Improve proxy initialization (continues #4871) #6272

Merged
merged 2 commits into from Jun 18, 2015

Conversation

Projects
None yet
2 participants
@laanwj
Member

laanwj commented Jun 12, 2015

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.

@Diapolo

View changes

src/init.cpp
+ if (onionArg == "0") { // Handle -noonion/-onion=0
+ SetReachable(NET_TOR, false); // set onions as unreachable
+ } else {
+ proxyType addrOnion;

This comment has been minimized.

@Diapolo

Diapolo Jun 12, 2015

Nit: Above you did this as one-liner, so I suggest proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize);

@Diapolo

Diapolo Jun 12, 2015

Nit: Above you did this as one-liner, so I suggest proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize);

This comment has been minimized.

@laanwj

laanwj Jun 12, 2015

Member

Good idea.

@laanwj

laanwj Jun 12, 2015

Member

Good idea.

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 12, 2015

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.

Diapolo commented Jun 12, 2015

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.

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.
@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 12, 2015

My node connects normally via proxy, the pull compiles without problems, so this has my ACK.

Diapolo commented Jun 12, 2015

My node connects normally via proxy, the pull compiles without problems, so this has my ACK.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jun 16, 2015

Member

Added more proxy tests (these test the output of getnetworkinfo)

Member

laanwj commented Jun 16, 2015

Added more proxy tests (these test the output of getnetworkinfo)

@laanwj laanwj merged commit edbdf88 into bitcoin:master Jun 18, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Jun 18, 2015

Merge pull request #6272
edbdf88 tests: Extend RPC proxy tests (Wladimir J. van der Laan)
baf0507 Improve proxy initialization (Wladimir J. van der Laan)

@str4d str4d referenced this pull request in zcash/zcash Feb 14, 2017

Merged

Bitcoin 0.12 misc PRs 1 #2099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment