Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve proxy initialization (continues #4871) #6272

Merged
merged 2 commits into from Jun 18, 2015

Conversation

@laanwj
Copy link
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
Diapolo reviewed Jun 12, 2015
View changes
src/init.cpp Outdated
if (onionArg == "0") { // Handle -noonion/-onion=0
SetReachable(NET_TOR, false); // set onions as unreachable
} else {
proxyType addrOnion;

This comment has been minimized.

Copy link
@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.

Copy link
@laanwj

laanwj Jun 12, 2015

Author Member

Good idea.

@Diapolo
Copy link

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.

@laanwj laanwj force-pushed the laanwj:2015_06_proxyinit branch Jun 12, 2015
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.
@laanwj laanwj force-pushed the laanwj:2015_06_proxyinit branch to baf0507 Jun 12, 2015
@Diapolo
Copy link

Diapolo commented Jun 12, 2015

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

Also test -noonion
@laanwj
Copy link
Member Author

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
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
edbdf88 tests: Extend RPC proxy tests (Wladimir J. van der Laan)
baf0507 Improve proxy initialization (Wladimir J. van der Laan)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.