Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | if (certFile != "-system-") { | ||||
qDebug() << QString("PaymentServer::%1: Using \"%2\" as trusted root " | qDebug() << QString("PaymentServer::%1: Using \"%2\" as trusted root " | ||||
"certificate.") | "certificate.") | ||||
.arg(__func__) | .arg(__func__) | ||||
.arg(certFile); | .arg(certFile); | ||||
certList = QSslCertificate::fromPath(certFile); | certList = QSslCertificate::fromPath(certFile); | ||||
// Use those certificates when fetching payment requests, too: | // Use those certificates when fetching payment requests, too: | ||||
QSslSocket::setDefaultCaCertificates(certList); | QSslSocket::setDefaultCaCertificates(certList); | ||||
} else | } else { | ||||
certList = QSslSocket::systemCaCertificates(); | certList = QSslSocket::systemCaCertificates(); | ||||
} | |||||
int nRootCerts = 0; | int nRootCerts = 0; | ||||
const QDateTime currentTime = QDateTime::currentDateTime(); | const QDateTime currentTime = QDateTime::currentDateTime(); | ||||
for (const QSslCertificate &cert : certList) { | for (const QSslCertificate &cert : certList) { | ||||
// Don't log nullptr certificates | // Don't log nullptr certificates | ||||
if (cert.isNull()) { | if (cert.isNull()) { | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | for (const std::pair<CScript, Amount> &sendingTo : sendingTos) { | ||||
// Extract and check destination addresses | // Extract and check destination addresses | ||||
CTxDestination dest; | CTxDestination dest; | ||||
if (ExtractDestination(sendingTo.first, dest)) { | if (ExtractDestination(sendingTo.first, dest)) { | ||||
// Append destination address | // Append destination address | ||||
addresses.append( | addresses.append( | ||||
QString::fromStdString(EncodeCashAddr(dest, Params()))); | QString::fromStdString(EncodeCashAddr(dest, Params()))); | ||||
} else if (!recipient.authenticatedMerchant.isEmpty()) { | } else if (!recipient.authenticatedMerchant.isEmpty()) { | ||||
// Unauthenticated payment requests to custom bitcoin addresses are | // Unauthenticated payment requests to custom bitcoin addresses are | ||||
// not supported | // not supported (there is no good way to tell the user where they | ||||
// (there is no good way to tell the user where they are paying in a | // are paying in a way they'd have a chance of understanding). | ||||
// way they'd | |||||
// have a chance of understanding). | |||||
Q_EMIT message(tr("Payment request rejected"), | Q_EMIT message(tr("Payment request rejected"), | ||||
tr("Unverified payment requests to custom payment " | tr("Unverified payment requests to custom payment " | ||||
"scripts are unsupported."), | "scripts are unsupported."), | ||||
CClientUIInterface::MSG_ERROR); | CClientUIInterface::MSG_ERROR); | ||||
return false; | return false; | ||||
} | } | ||||
// Bitcoin amounts are stored as (optional) uint64 in the protobuf | // Bitcoin amounts are stored as (optional) uint64 in the protobuf | ||||
▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines |