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

if (onionArg == "0") { // Handle -noonion/-onion=0
SetReachable(NET_TOR, false); // set onions as unreachable
} else {
proxyType addrOnion;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
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
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)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants