HomePhabricator

Merge #12650: gui: Fix issue: "default port not shown correctly in settingsā€¦

Description

Merge #12650: gui: Fix issue: "default port not shown correctly in settings dialog"

Summary:
40c5886 Fix illegal default addProxy and addrSeparateProxyTor settings. (251)

Pull request description:

In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method:

https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129

https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139

This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`.

This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug.

The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value.

Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d

Backport of Core PR12650
https://github.com/bitcoin/bitcoin/pull/12650/

Test Plan:

make check
bitcoin-qt -> settings -> options -> network -> verify proxy port is 9050

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3885

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Apr 11 2018, 12:43
nakihitoCommitted on Aug 16 2019, 18:42
nakihitoPushed on Aug 16 2019, 18:42
Reviewer
Restricted Owners Package
Differential Revision
D3885: Merge #12650: gui: Fix issue: "default port not shown correctly in settings dialog"
Parents
rABC6ffbbc121d40: Merge #11353: Small refactor of CCoinsViewCache::BatchWrite()
Branches
Unknown
Tags
Unknown