mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
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.
This commit is contained in:
parent
0d509bab45
commit
10c5275ba4
1 changed files with 5 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <node/chainstatemanager_args.h>
|
||||
#include <netbase.h>
|
||||
#include <txdb.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
|
@ -482,7 +483,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())
|
||||
|
|
Loading…
Add table
Reference in a new issue