Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
paymentserver.cpp
Go to the documentation of this file.
104 qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);
106 qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::DistinguishedNameQualifier) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);
131 qDebug() << QString("PaymentServer::%1: Payment request authentication via X.509 certificates disabled.").arg(__func__);
138 qDebug() << QString("PaymentServer::%1: Using \"%2\" as trusted root certificate.").arg(__func__).arg(certFile);
256 qWarning() << "PaymentServer::ipcSendCommandLine: Payment request file does not exist: " << arg;
378 qDebug() << "PaymentServer::initNetManager: Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port();
452 tr("URI cannot be parsed! This can be caused by an invalid Dash address or malformed URI parameters."),
466 tr("Payment request file cannot be read! This can be caused by an invalid payment request file."),
501 bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request)
519 bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient)
527 Q_EMIT message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."),
573 // Dash amounts are stored as (optional) uint64 in the protobuf messages (see paymentrequest.proto),
574 // but CAmount is defined as int64_t. Because of that we need to verify that amounts are in a valid range
577 Q_EMIT message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR);
584 Q_EMIT message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).")
594 Q_EMIT message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR);
602 qDebug() << "PaymentServer::processPaymentRequest: Secure payment request from " << recipient.authenticatedMerchant;
605 qDebug() << "PaymentServer::processPaymentRequest: Insecure payment request to " << addresses.join(", ");
621 void PaymentServer::fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction)
758 Q_EMIT message(tr("Payment acknowledged"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL);
765 qWarning() << QString("PaymentServer::%1: Payment request network \"%2\" doesn't match client network \"%3\".")
775 bool fVerified = (requestDetails.has_expires() && (int64_t)requestDetails.expires() < GetTime());
777 const QString requestExpires = QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", (int64_t)requestDetails.expires()));
789 qWarning() << QString("PaymentServer::%1: Payment request too large (%2 bytes, allowed %3 bytes).")
801 qWarning() << QString("PaymentServer::%1: Payment request amount out of allowed range (%2, allowed 0 - %3).")
static void LoadRootCAs(X509_STORE *store=nullptr)
Definition: paymentserver.cpp:113
std::string NetworkIDString() const
Return the BIP70 network string (main, test or regtest)
Definition: chainparams.h:76
static bool verifyAmount(const CAmount &requestAmount)
Definition: paymentserver.cpp:797
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
Definition: standard.cpp:158
void message(const QString &title, const QString &message, unsigned int style)
static bool verifyNetwork(const payments::PaymentDetails &requestDetails)
Definition: paymentserver.cpp:761
bool getProxySettings(QNetworkProxy &proxy) const
Definition: optionsmodel.cpp:635
void setOptionsModel(OptionsModel *optionsModel)
Definition: paymentserver.cpp:750
Definition: paymentserver.cpp:67
static const CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
Definition: amount.h:26
bool processPaymentRequest(const PaymentRequestPlus &request, SendCoinsRecipient &recipient)
Definition: paymentserver.cpp:519
bool eventFilter(QObject *object, QEvent *event)
Definition: paymentserver.cpp:348
void handlePaymentACK(const QString &paymentACKMsg)
Definition: paymentserver.cpp:755
std::string DateTimeStrFormat(const char *pszFormat, int64_t nTime)
Definition: utiltime.cpp:93
void receivedPaymentACK(const QString &paymentACKMsg)
void receivedPaymentRequest(SendCoinsRecipient)
QString HtmlEscape(const QString &str, bool fMultiLine)
Definition: guiutil.cpp:481
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
Definition: guiutil.cpp:358
static void ipcParseCommandLine(int argc, char *argv[])
Definition: paymentserver.cpp:204
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Definition: pubkey.h:149
static QT_END_NAMESPACE const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE
Definition: paymentserver.h:56
Definition: paymentrequestplus.h:28
void handleURIOrFile(const QString &s)
Definition: paymentserver.cpp:401
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:64
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:20
static void ReportInvalidCertificate(const QSslCertificate &cert)
Definition: paymentserver.cpp:101
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
Definition: wallet.cpp:4277
bool IsValidDestinationString(const std::string &str, const CChainParams ¶ms)
Definition: base58.cpp:341
void netRequestFinished(QNetworkReply *)
Definition: paymentserver.cpp:676
bool getMerchant(X509_STORE *certStore, QString &merchant) const
Definition: paymentrequestplus.cpp:60
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
Definition: chainparams.cpp:952
static bool readPaymentRequestFromFile(const QString &filename, PaymentRequestPlus &request)
Definition: paymentserver.cpp:501
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
Definition: chainparams.cpp:965
const char * BIP70_MESSAGE_PAYMENTREQUEST
Definition: paymentserver.cpp:55
Definition: walletmodel.h:39
const payments::PaymentDetails & getDetails() const
Definition: paymentrequestplus.h:44
static bool verifyExpired(const payments::PaymentDetails &requestDetails)
Definition: paymentserver.cpp:773
QList< std::pair< CScript, CAmount > > getPayTo() const
Definition: paymentrequestplus.cpp:208
PaymentServer(QObject *parent, bool startLocalServer=true)
Definition: paymentserver.cpp:300
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Definition: standard.cpp:256
Definition: ui_interface.h:72
const std::string CLIENT_NAME
void fetchPaymentACK(CWallet *wallet, const SendCoinsRecipient &recipient, QByteArray transaction)
Definition: paymentserver.cpp:621
const char * BIP71_MIMETYPE_PAYMENTREQUEST
Definition: paymentserver.cpp:59
void reportSslErrors(QNetworkReply *, const QList< QSslError > &)
Definition: paymentserver.cpp:738
std::set< CTxDestination > GetAccountAddresses(const std::string &strAccount) const
Definition: wallet.cpp:4707
std::string EncodeDestination(const CTxDestination &dest)
Definition: base58.cpp:329
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:25
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: util.cpp:808
const QString BITCOIN_IPC_PREFIX("dash:")
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:715
static bool verifySize(qint64 requestSize)
Definition: paymentserver.cpp:785
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
Definition: bitcoinunits.cpp:162
QString boostPathToQString(const fs::path &path)
Definition: guiutil.cpp:1828
Definition: paymentserver.cpp:61