diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-07-22 16:50:39 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-08-22 16:18:25 +1000 |
commit | a41d5fe01947f2f878c055670986a165af800f9a (patch) | |
tree | 40eeada1ebc180f8e3669a7d164104686dc0c618 /src/qt/transactiondesc.cpp | |
parent | 47d0534368fbf0e3fb2cad7d05d60501d29f62aa (diff) |
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.
Diffstat (limited to 'src/qt/transactiondesc.cpp')
-rw-r--r-- | src/qt/transactiondesc.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index e9f3eb478d..25ff3623c0 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -7,6 +7,7 @@ #include "db.h" #include "ui_interface.h" #include "base58.h" +#include "paymentserver.h" #include <string> @@ -216,6 +217,21 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) strHTML += "<b>" + tr("Transaction ID") + ":</b> " + wtx.GetHash().ToString().c_str() + "<br>"; + // + // PaymentRequest info: + // + foreach (const PAIRTYPE(string, string)& r, wtx.vOrderForm) + { + if (r.first == "PaymentRequest") + { + PaymentRequestPlus req; + req.parse(QByteArray::fromRawData(r.second.c_str(), r.second.size())); + QString merchant; + if (req.getMerchant(PaymentServer::getCertStore(), merchant)) + strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>"; + } + } + if (wtx.IsCoinBase()) strHTML += "<br>" + tr("Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>"; |