aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentrequestplus.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-09-04 11:52:45 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-09-06 10:32:07 +0200
commit42018eff07d235930ca91fa9e76e7ac128183438 (patch)
treee90e584fb8643d63ee9c6083599b29b0ed48bded /src/qt/paymentrequestplus.cpp
parentd22d9753cc7175a7cf0ce440b96d83277747ecb9 (diff)
Bitcoin-Qt: Use qDebug() for printing to debug.log
- removes all usages of PrintDebugStringF from Qt code - ensure same format for all debug.log messages "functionname : Message"
Diffstat (limited to 'src/qt/paymentrequestplus.cpp')
-rw-r--r--src/qt/paymentrequestplus.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp
index 289ddabb92..50fb1bd777 100644
--- a/src/qt/paymentrequestplus.cpp
+++ b/src/qt/paymentrequestplus.cpp
@@ -24,18 +24,18 @@ bool PaymentRequestPlus::parse(const QByteArray& data)
{
bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size());
if (!parseOK) {
- qDebug() << "Error parsing payment request";
+ qDebug() << "PaymentRequestPlus::parse : Error parsing payment request";
return false;
}
if (paymentRequest.payment_details_version() > 1) {
- qDebug() << "Received up-version payment details, version=" << paymentRequest.payment_details_version();
+ qDebug() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version();
return false;
}
parseOK = details.ParseFromString(paymentRequest.serialized_payment_details());
if (!parseOK)
{
- qDebug() << "Error parsing payment details";
+ qDebug() << "PaymentRequestPlus::parse : Error parsing payment details";
paymentRequest.Clear();
return false;
}
@@ -75,17 +75,18 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
digestAlgorithm = EVP_sha1();
}
else if (paymentRequest.pki_type() == "none") {
- if (fDebug) qDebug() << "PaymentRequest: pki_type == none";
+ if (fDebug)
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
return false;
}
else {
- qDebug() << "PaymentRequest: unknown pki_type " << paymentRequest.pki_type().c_str();
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << paymentRequest.pki_type().c_str();
return false;
}
payments::X509Certificates certChain;
if (!certChain.ParseFromString(paymentRequest.pki_data())) {
- qDebug() << "PaymentRequest: error parsing pki_data";
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data";
return false;
}
@@ -95,12 +96,12 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size());
QSslCertificate qCert(certData, QSsl::Der);
if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) {
- qDebug() << "PaymentRequest: certificate expired or not yet active: " << qCert;
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert;
return false;
}
#if QT_VERSION >= 0x050000
if (qCert.isBlacklisted()) {
- qDebug() << "PaymentRequest: certificate blacklisted: " << qCert;
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert;
return false;
}
#endif
@@ -110,7 +111,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
certs.push_back(cert);
}
if (certs.empty()) {
- qDebug() << "PaymentRequest: empty certificate chain";
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain";
return false;
}
@@ -126,7 +127,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
// load the signing cert into it and verify.
X509_STORE_CTX *store_ctx = X509_STORE_CTX_new();
if (!store_ctx) {
- qDebug() << "PaymentRequest: error creating X509_STORE_CTX";
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX";
return false;
}
@@ -171,14 +172,14 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
merchant = website;
}
else {
- throw SSLVerifyError("Bad certificate, missing common name");
+ throw SSLVerifyError("Bad certificate, missing common name.");
}
// TODO: detect EV certificates and set merchant = business name instead of unfriendly NID_commonName ?
}
catch (SSLVerifyError& err)
{
fResult = false;
- qDebug() << "PaymentRequestPlus::getMerchant SSL err: " << err.what();
+ qDebug() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what();
}
if (website)