Skip to content

Commit

Permalink
gui: don't permit port in proxy IP option
Browse files Browse the repository at this point in the history
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.

Github-Pull: bitcoin-core/gui#813
Rebased-From: 10c5275
  • Loading branch information
willcl-ark authored and fanquake committed May 13, 2024
1 parent d1289a1 commit dedf319
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <node/chainstatemanager_args.h>
#include <netbase.h>
#include <txdb.h>
#include <util/strencodings.h>

#include <chrono>

Expand Down Expand Up @@ -478,7 +479,10 @@ QValidator(parent)
QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const
{
Q_UNUSED(pos);
// Validate the proxy
uint16_t port{0};
std::string hostname;
if (!SplitHostPort(input.toStdString(), port, hostname) || port != 0) return QValidator::Invalid;

CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
Proxy addrProxy = Proxy(serv, true);
if (addrProxy.IsValid())
Expand Down

0 comments on commit dedf319

Please sign in to comment.