aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-12-01 12:08:31 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-12-07 17:34:16 +0100
commitf05d34988719b22ef5c64888f90b4c8f3a2c7931 (patch)
treecaf39100cf1aa4cf7c1447908c5d6fd429c8ea70 /src/qt/optionsmodel.h
parent16fff802574159286e424802442551dc9eba9098 (diff)
gui: Fix proxy setting options dialog crash
This fixes a crash bug when opening the options dialog. - Check the return value of split() to avoid segmentation faults due to out of bounds when the user manages to enter invalid proxy settings. This is reported resonably often. - Move the default proxy/port to a constant instead of hardcoding magic values. - Factor out some common code. - Revert #11448 because this proves a more robust replacement, it is no longer necessary and didn't generally solve the issue. No attempt is made to do full sanity checking on the proxy, so it can still be rejected by the core with an InitError message.
Diffstat (limited to 'src/qt/optionsmodel.h')
-rw-r--r--src/qt/optionsmodel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index b6e8fdef68..f8782dd204 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -13,6 +13,9 @@ QT_BEGIN_NAMESPACE
class QNetworkProxy;
QT_END_NAMESPACE
+extern const char *DEFAULT_GUI_PROXY_HOST;
+static constexpr unsigned short DEFAULT_GUI_PROXY_PORT = 9050;
+
/** Interface from Qt to configuration data structure for Bitcoin client.
To Qt, the options are presented as a list with the different options
laid out vertically.