aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-12-20 18:47:49 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2014-01-17 15:43:44 +0100
commit1ba3560fe870dac8d27d75671c483eaa4e0009ff (patch)
tree3925fb306afea23ecc717c9ec2ce329ff56a8030 /src/qt/paymentserver.cpp
parent08ede8ef5edd8bfe6b80d0900bd9bd65b2d45cbf (diff)
[Qt] let OptionsModel::getProxySettings() directly query proxy
- as a proxy set via GUI can be overridden via -proxy, directly query the core to get active proxy - give a warning, if active proxy is not SOCKS5 (needs to be SOCKS5 for the Qt networking code to work) - also remove an obsolete connect() call from optionsdialog.cpp and a reference to Bitcoin-Qt (now just GUI)
Diffstat (limited to 'src/qt/paymentserver.cpp')
-rw-r--r--src/qt/paymentserver.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 7642cd117a..ca6ae17990 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -335,17 +335,22 @@ void PaymentServer::initNetManager()
// netManager is used to fetch paymentrequests given in bitcoin: URIs
netManager = new QNetworkAccessManager(this);
- // Use proxy settings from optionsModel
- QString proxyIP;
- quint16 proxyPort;
- if (optionsModel->getProxySettings(proxyIP, proxyPort))
- {
- QNetworkProxy proxy;
- proxy.setType(QNetworkProxy::Socks5Proxy);
- proxy.setHostName(proxyIP);
- proxy.setPort(proxyPort);
- netManager->setProxy(proxy);
+ QNetworkProxy proxy;
+
+ // Query active proxy (fails if no SOCKS5 proxy)
+ if (optionsModel->getProxySettings(proxy)) {
+ if (proxy.type() == QNetworkProxy::Socks5Proxy) {
+ netManager->setProxy(proxy);
+
+ qDebug() << "PaymentServer::initNetManager : Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port();
+ }
+ else
+ qDebug() << "PaymentServer::initNetManager : No active proxy server found.";
}
+ else
+ emit message(tr("Net manager warning"),
+ tr("Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy."),
+ CClientUIInterface::MSG_WARNING);
connect(netManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(netRequestFinished(QNetworkReply*)));