From 9dcf6c0dfec51f2a49edef537f377422d6dbdceb Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 6 Nov 2017 19:12:47 +0100 Subject: 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. --- src/qt/paymentserver.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/qt/paymentserver.h') 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 +#endif + +#ifdef ENABLE_BIP70 #include +#endif #include #include @@ -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 &); 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; }; -- cgit v1.2.3