aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-11-09 16:41:15 +0100
committerJames Hilliard <james.hilliard1@gmail.com>2018-10-22 04:03:17 -0600
commit38b98507cdda02ff02a524d41bcc3427ca9e4fd9 (patch)
treee6f9a2fb8b7e16015e5eeaae6afd41f4504896f0 /src/qt/paymentserver.h
parent9dcf6c0dfec51f2a49edef537f377422d6dbdceb (diff)
qt: cleanup: Move BIP70 functions together in paymentserver
Reduces the number of separate `#ifdefs` spans.
Diffstat (limited to 'src/qt/paymentserver.h')
-rw-r--r--src/qt/paymentserver.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index eba195e3bd..30b5bc3b6d 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -79,6 +79,9 @@ public:
explicit PaymentServer(QObject* parent, bool startLocalServer = true);
~PaymentServer();
+ // OptionsModel is used for getting proxy settings and display unit
+ void setOptionsModel(OptionsModel *optionsModel);
+
#ifdef ENABLE_BIP70
// Load root certificate authorities. Pass nullptr (default)
// to read from the file specified in the -rootcertificates setting,
@@ -89,12 +92,7 @@ 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
@@ -109,27 +107,27 @@ Q_SIGNALS:
// Fired when a valid payment request is received
void receivedPaymentRequest(SendCoinsRecipient);
+ // Fired when a message should be reported to the user
+ void message(const QString &title, const QString &message, unsigned int style);
+
#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);
-
public Q_SLOTS:
// Signal this when the main window's UI is ready
// to display payment requests to the user
void uiReady();
+ // Handle an incoming URI, URI with local file scheme or file
+ void handleURIOrFile(const QString& s);
+
#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
@@ -144,6 +142,10 @@ protected:
bool eventFilter(QObject *object, QEvent *event);
private:
+ bool saveURIs; // true during startup
+ QLocalServer* uriServer;
+ OptionsModel *optionsModel;
+
#ifdef ENABLE_BIP70
static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request);
bool processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient);
@@ -151,16 +153,8 @@ private:
// 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;
};
#endif // BITCOIN_QT_PAYMENTSERVER_H