mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03: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()
|
||||
{
|
||||
const std::optional<CNetAddr> ui_proxy_netaddr{LookupHost(ui->proxyIp->text().toStdString(), /*fAllowLookup=*/false)};
|
||||
const CService ui_proxy{ui_proxy_netaddr.value_or(CNetAddr{}), ui->proxyPort->text().toUShort()};
|
||||
std::string proxyIpText{ui->proxyIp->text().toStdString()};
|
||||
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;
|
||||
bool has_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);
|
||||
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);
|
||||
ui->proxyReachTor->setChecked(has_proxy && proxy.proxy == ui_proxy);
|
||||
ui->proxyReachTor->setChecked(has_proxy && proxy.ToString() == proxyIpText);
|
||||
}
|
||||
|
||||
ProxyAddressValidator::ProxyAddressValidator(QObject *parent) :
|
||||
|
|
Loading…
Add table
Reference in a new issue