Skip to content

Commit 10c5275

Browse files
committed
gui: don't permit port in proxy IP option
Fixes: #809 Previously it was possible through the GUI to enter an IP address:port into the "Proxy IP" configuration box. After the node was restarted the errant setting would prevent the node starting back up until manually removed from settings.json.
1 parent 0d509ba commit 10c5275

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/qt/optionsdialog.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <node/chainstatemanager_args.h>
2121
#include <netbase.h>
2222
#include <txdb.h>
23+
#include <util/strencodings.h>
2324

2425
#include <chrono>
2526

@@ -482,7 +483,10 @@ QValidator(parent)
482483
QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const
483484
{
484485
Q_UNUSED(pos);
485-
// Validate the proxy
486+
uint16_t port{0};
487+
std::string hostname;
488+
if (!SplitHostPort(input.toStdString(), port, hostname) || port != 0) return QValidator::Invalid;
489+
486490
CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
487491
Proxy addrProxy = Proxy(serv, true);
488492
if (addrProxy.IsValid())

0 commit comments

Comments
 (0)