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

-connect doesn't turn off -listen in bitcoin-qt #6773

Closed
dooglus opened this issue Oct 7, 2015 · 2 comments · Fixed by #6780
Closed

-connect doesn't turn off -listen in bitcoin-qt #6773

dooglus opened this issue Oct 7, 2015 · 2 comments · Fixed by #6780
Labels

Comments

@dooglus
Copy link
Contributor

dooglus commented Oct 7, 2015

I built commit a75c673 (on the master branch), dated Mon Oct 5 13:41:27 2015 +0200.

When I run bitcoind, I can specify -connect=127.0.0.1 and it turns off the -listen option automatically.

If I try the same with bitcoin-qt it doesn't.

qt/optionsmodel.cpp is running the following code to set -listen to its default value before any of the logic about -connect implying -listen=0 runs:

if (!SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
    addOverriddenOption("-listen");

Later, init.cpp runs:

    if (SoftSetBoolArg("-listen", false))
        LogPrintf("%s: parameter interaction: -connect set -> setting -listen=0\n", __func__);

but it's too late. SoftSetBoolArg will only change the value of the setting once, and optionsmodel.cpp has already set it.

@laanwj laanwj added the GUI label Oct 7, 2015
@laanwj
Copy link
Member

laanwj commented Oct 7, 2015

Bleh. Good catch. Most straightforward solution would probably be to split off the parameter-interaction part from AppInit2 and run it before the optionsmodel is initialized.

@Diapolo
Copy link

Diapolo commented Oct 21, 2015

Was this fixed via #6780?

@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 a pull request may close this issue.

3 participants