diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2015-01-15 09:13:32 +0100 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2015-08-10 14:12:15 +0200 |
commit | be942def4baac40b1031ba26491a24a55e1a6a6c (patch) | |
tree | 78f382f60b7caf81d71ecde2a6eebc563d5379df /src/qt/paymentserver.h | |
parent | c0f66ce44abdc44ddbff892720d5b85f6a95436d (diff) |
[Qt] add verifySize() function to PaymentServer
- add static verifySize() function to PaymentServer and move the logging
on error into the function
- also use the new function in the unit test
- the function checks if the size is allowed as per BIP70
Diffstat (limited to 'src/qt/paymentserver.h')
-rw-r--r-- | src/qt/paymentserver.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index 5df0a14cf7..fa120a435c 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -88,13 +88,12 @@ public: // OptionsModel is used for getting proxy settings and display unit void setOptionsModel(OptionsModel *optionsModel); - // This is now public, because we use it in paymentservertests.cpp - static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); - // Verify that the payment request network matches the client network static bool verifyNetwork(const payments::PaymentDetails& requestDetails); // Verify if the payment request is expired static bool verifyExpired(const payments::PaymentDetails& requestDetails); + // Verify the payment request size is valid as per BIP70 + static bool verifySize(qint64 requestSize); // Verify the payment request amount is valid static bool verifyAmount(const CAmount& requestAmount); @@ -131,6 +130,7 @@ protected: bool eventFilter(QObject *object, QEvent *event); private: + static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); bool processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); |