mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
gui: accomodate unix socket Proxy in updateDefaultProxyNets()
This will require a follow-up to add unix socket options to the GUI
This commit is contained in:
parent
a88bf9dedd
commit
c3bd43142e
1 changed files with 9 additions and 5 deletions
|
@ -454,20 +454,24 @@ void OptionsDialog::updateProxyValidationState()
|
||||||
|
|
||||||
void OptionsDialog::updateDefaultProxyNets()
|
void OptionsDialog::updateDefaultProxyNets()
|
||||||
{
|
{
|
||||||
const std::optional<CNetAddr> ui_proxy_netaddr{LookupHost(ui->proxyIp->text().toStdString(), /*fAllowLookup=*/false)};
|
std::string proxyIpText{ui->proxyIp->text().toStdString()};
|
||||||
const CService ui_proxy{ui_proxy_netaddr.value_or(CNetAddr{}), ui->proxyPort->text().toUShort()};
|
if (!IsUnixSocketPath(proxyIpText)) {
|
||||||
|
const std::optional<CNetAddr> ui_proxy_netaddr{LookupHost(proxyIpText, /*fAllowLookup=*/false)};
|
||||||
|
const CService ui_proxy{ui_proxy_netaddr.value_or(CNetAddr{}), ui->proxyPort->text().toUShort()};
|
||||||
|
proxyIpText = ui_proxy.ToStringAddrPort();
|
||||||
|
}
|
||||||
|
|
||||||
Proxy proxy;
|
Proxy proxy;
|
||||||
bool has_proxy;
|
bool has_proxy;
|
||||||
|
|
||||||
has_proxy = model->node().getProxy(NET_IPV4, proxy);
|
has_proxy = model->node().getProxy(NET_IPV4, proxy);
|
||||||
ui->proxyReachIPv4->setChecked(has_proxy && proxy.proxy == ui_proxy);
|
ui->proxyReachIPv4->setChecked(has_proxy && proxy.ToString() == proxyIpText);
|
||||||
|
|
||||||
has_proxy = model->node().getProxy(NET_IPV6, proxy);
|
has_proxy = model->node().getProxy(NET_IPV6, proxy);
|
||||||
ui->proxyReachIPv6->setChecked(has_proxy && proxy.proxy == ui_proxy);
|
ui->proxyReachIPv6->setChecked(has_proxy && proxy.ToString() == proxyIpText);
|
||||||
|
|
||||||
has_proxy = model->node().getProxy(NET_ONION, proxy);
|
has_proxy = model->node().getProxy(NET_ONION, proxy);
|
||||||
ui->proxyReachTor->setChecked(has_proxy && proxy.proxy == ui_proxy);
|
ui->proxyReachTor->setChecked(has_proxy && proxy.ToString() == proxyIpText);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyAddressValidator::ProxyAddressValidator(QObject *parent) :
|
ProxyAddressValidator::ProxyAddressValidator(QObject *parent) :
|
||||||
|
|
Loading…
Add table
Reference in a new issue