From a41d5fe01947f2f878c055670986a165af800f9a Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 22 Jul 2013 16:50:39 +1000 Subject: Payment Protocol: X509-validated payment requests Add support for a Payment Protocol to Bitcoin-Qt. Payment messages are protocol-buffer encoded and communicated over http(s), so this adds a dependency on the Google protocol buffer library, and requires Qt with OpenSSL support. --- src/qt/walletmodel.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/qt/walletmodel.h') diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index f14b09effe..8cba10f5d2 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -4,6 +4,7 @@ #include #include "allocators.h" /* for SecureString */ +#include "paymentrequestplus.h" class OptionsModel; class AddressTableModel; @@ -17,9 +18,15 @@ QT_END_NAMESPACE class SendCoinsRecipient { public: + SendCoinsRecipient() : amount(0) { } + QString address; QString label; qint64 amount; + + // If from a payment request, paymentRequest.IsInitialized() will be true + PaymentRequestPlus paymentRequest; + QString authenticatedMerchant; // Empty if no authentication or invalid signature/cert/etc. }; /** Interface to Bitcoin wallet from Qt view code. */ @@ -68,12 +75,10 @@ public: struct SendCoinsReturn { SendCoinsReturn(StatusCode status, - qint64 fee=0, - QString hex=QString()): - status(status), fee(fee), hex(hex) {} + qint64 fee=0): + status(status), fee(fee) {} StatusCode status; qint64 fee; // is used in case status is "AmountWithFeeExceedsBalance" - QString hex; // is filled with the transaction hash if status is "OK" }; // Send coins to a list of recipients @@ -151,6 +156,9 @@ signals: // Asynchronous message notification void message(const QString &title, const QString &message, unsigned int style); + // Coins sent: from wallet, to recipient, in (serialized) transaction: + void coinsSent(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction); + public slots: /* Wallet status might have changed */ void updateStatus(); -- cgit v1.2.3