|
|
@ -90,7 +90,7 @@ static QList<QString> savedPaymentRequests; |
|
|
|
|
|
|
|
|
|
|
|
static void ReportInvalidCertificate(const QSslCertificate& cert) |
|
|
|
static void ReportInvalidCertificate(const QSslCertificate& cert) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); |
|
|
|
qWarning() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -161,7 +161,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates"; |
|
|
|
qWarning() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates"; |
|
|
|
|
|
|
|
|
|
|
|
// Project for another day:
|
|
|
|
// Project for another day:
|
|
|
|
// Fetch certificate revocation lists, and add them to certStore.
|
|
|
|
// Fetch certificate revocation lists, and add them to certStore.
|
|
|
@ -223,7 +223,7 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Printing to debug.log is about the best we can do here, the
|
|
|
|
// Printing to debug.log is about the best we can do here, the
|
|
|
|
// GUI hasn't started yet so we can't pop up a message box.
|
|
|
|
// GUI hasn't started yet so we can't pop up a message box.
|
|
|
|
qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; |
|
|
|
qWarning() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -403,7 +403,7 @@ void PaymentServer::handleURIOrFile(const QString& s) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; |
|
|
|
qWarning() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; |
|
|
|
emit message(tr("URI handling"), |
|
|
|
emit message(tr("URI handling"), |
|
|
|
tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), |
|
|
|
tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), |
|
|
|
CClientUIInterface::ICON_WARNING); |
|
|
|
CClientUIInterface::ICON_WARNING); |
|
|
@ -476,13 +476,13 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl |
|
|
|
QFile f(filename); |
|
|
|
QFile f(filename); |
|
|
|
if (!f.open(QIODevice::ReadOnly)) |
|
|
|
if (!f.open(QIODevice::ReadOnly)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "PaymentServer::readPaymentRequest : Failed to open " << filename; |
|
|
|
qWarning() << "PaymentServer::readPaymentRequest : Failed to open " << filename; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (f.size() > MAX_PAYMENT_REQUEST_SIZE) |
|
|
|
if (f.size() > MAX_PAYMENT_REQUEST_SIZE) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "PaymentServer::readPaymentRequest : " << filename << " too large"; |
|
|
|
qWarning() << "PaymentServer::readPaymentRequest : " << filename << " too large"; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -624,7 +624,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien |
|
|
|
else { |
|
|
|
else { |
|
|
|
// This should never happen, because sending coins should have
|
|
|
|
// This should never happen, because sending coins should have
|
|
|
|
// just unlocked the wallet and refilled the keypool.
|
|
|
|
// just unlocked the wallet and refilled the keypool.
|
|
|
|
qDebug() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; |
|
|
|
qWarning() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -636,7 +636,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
// This should never happen, either.
|
|
|
|
// This should never happen, either.
|
|
|
|
qDebug() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; |
|
|
|
qWarning() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -649,7 +649,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) |
|
|
|
.arg(reply->request().url().toString()) |
|
|
|
.arg(reply->request().url().toString()) |
|
|
|
.arg(reply->errorString()); |
|
|
|
.arg(reply->errorString()); |
|
|
|
|
|
|
|
|
|
|
|
qDebug() << "PaymentServer::netRequestFinished : " << msg; |
|
|
|
qWarning() << "PaymentServer::netRequestFinished : " << msg; |
|
|
|
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); |
|
|
|
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -663,7 +663,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) |
|
|
|
SendCoinsRecipient recipient; |
|
|
|
SendCoinsRecipient recipient; |
|
|
|
if (!request.parse(data)) |
|
|
|
if (!request.parse(data)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "PaymentServer::netRequestFinished : Error parsing payment request"; |
|
|
|
qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request"; |
|
|
|
emit message(tr("Payment request error"), |
|
|
|
emit message(tr("Payment request error"), |
|
|
|
tr("Payment request can not be parsed!"), |
|
|
|
tr("Payment request can not be parsed!"), |
|
|
|
CClientUIInterface::MSG_ERROR); |
|
|
|
CClientUIInterface::MSG_ERROR); |
|
|
@ -681,7 +681,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) |
|
|
|
QString msg = tr("Bad response from server %1") |
|
|
|
QString msg = tr("Bad response from server %1") |
|
|
|
.arg(reply->request().url().toString()); |
|
|
|
.arg(reply->request().url().toString()); |
|
|
|
|
|
|
|
|
|
|
|
qDebug() << "PaymentServer::netRequestFinished : " << msg; |
|
|
|
qWarning() << "PaymentServer::netRequestFinished : " << msg; |
|
|
|
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); |
|
|
|
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -697,7 +697,7 @@ void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError> |
|
|
|
|
|
|
|
|
|
|
|
QString errString; |
|
|
|
QString errString; |
|
|
|
foreach (const QSslError& err, errs) { |
|
|
|
foreach (const QSslError& err, errs) { |
|
|
|
qDebug() << "PaymentServer::reportSslErrors : " << err; |
|
|
|
qWarning() << "PaymentServer::reportSslErrors : " << err; |
|
|
|
errString += err.errorString() + "\n"; |
|
|
|
errString += err.errorString() + "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR); |
|
|
|
emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR); |
|
|
|