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

issue dooglus opened this issue on October 7, 2015
  1. dooglus commented at 7:52 AM on October 7, 2015: contributor

    I built commit a75c67364d3484147c0643baf535845ce72a50cc (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.

  2. laanwj added the label GUI on Oct 7, 2015
  3. laanwj commented at 8:15 AM on October 7, 2015: member

    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.

  4. laanwj added the label Priority Medium on Oct 7, 2015
  5. Diapolo commented at 8:36 PM on October 21, 2015: none

    Was this fixed via #6780?

  6. laanwj closed this on Nov 27, 2015

  7. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-16 00:15 UTC

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