diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-06 19:12:47 +0100 |
---|---|---|
committer | James Hilliard <james.hilliard1@gmail.com> | 2018-10-09 03:36:14 -0600 |
commit | 9dcf6c0dfec51f2a49edef537f377422d6dbdceb (patch) | |
tree | 68628f5648acc166e1bdbd5f3cfbe0cec5caa8d1 /src/qt/paymentserver.h | |
parent | 1d1417430c829a0c21bf5a2fe4a5b2f592a9423f (diff) |
build: Add --disable-bip70 configure option
This patch adds a --disable-bip70 configure option that disables BIP70
payment request support. When disabled, this removes the dependency of
the GUI on OpenSSL and Protobuf.
Diffstat (limited to 'src/qt/paymentserver.h')
-rw-r--r-- | src/qt/paymentserver.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index d335db9c85..eba195e3bd 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -32,7 +32,13 @@ // sends them to the server. // +#if defined(HAVE_CONFIG_H) +#include <config/bitcoin-config.h> +#endif + +#ifdef ENABLE_BIP70 #include <qt/paymentrequestplus.h> +#endif #include <qt/walletmodel.h> #include <QObject> @@ -73,6 +79,7 @@ public: explicit PaymentServer(QObject* parent, bool startLocalServer = true); ~PaymentServer(); +#ifdef ENABLE_BIP70 // Load root certificate authorities. Pass nullptr (default) // to read from the file specified in the -rootcertificates setting, // or, if that's not set, to use the system default root certificates. @@ -82,10 +89,12 @@ public: // Return certificate store static X509_STORE* getCertStore(); +#endif // OptionsModel is used for getting proxy settings and display unit void setOptionsModel(OptionsModel *optionsModel); +#ifdef ENABLE_BIP70 // Verify that the payment request network matches the client network static bool verifyNetwork(interfaces::Node& node, const payments::PaymentDetails& requestDetails); // Verify if the payment request is expired @@ -94,13 +103,16 @@ public: static bool verifySize(qint64 requestSize); // Verify the payment request amount is valid static bool verifyAmount(const CAmount& requestAmount); +#endif Q_SIGNALS: // Fired when a valid payment request is received void receivedPaymentRequest(SendCoinsRecipient); +#ifdef ENABLE_BIP70 // Fired when a valid PaymentACK is received void receivedPaymentACK(const QString &paymentACKMsg); +#endif // Fired when a message should be reported to the user void message(const QString &title, const QString &message, unsigned int style); @@ -110,17 +122,21 @@ public Q_SLOTS: // to display payment requests to the user void uiReady(); +#ifdef ENABLE_BIP70 // Submit Payment message to a merchant, get back PaymentACK: void fetchPaymentACK(WalletModel* walletModel, const SendCoinsRecipient& recipient, QByteArray transaction); +#endif // Handle an incoming URI, URI with local file scheme or file void handleURIOrFile(const QString& s); private Q_SLOTS: void handleURIConnection(); +#ifdef ENABLE_BIP70 void netRequestFinished(QNetworkReply*); void reportSslErrors(QNetworkReply*, const QList<QSslError> &); void handlePaymentACK(const QString& paymentACKMsg); +#endif protected: // Constructor registers this on the parent QApplication to @@ -128,17 +144,21 @@ protected: bool eventFilter(QObject *object, QEvent *event); private: +#ifdef ENABLE_BIP70 static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); bool processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); // Setup networking void initNetManager(); +#endif bool saveURIs; // true during startup QLocalServer* uriServer; +#ifdef ENABLE_BIP70 QNetworkAccessManager* netManager; // Used to fetch payment requests +#endif OptionsModel *optionsModel; }; |