diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-10-30 11:26:44 +0100 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-10-31 17:51:40 +0100 |
commit | 395d0d5af017bbf6d432471075608efaf4104a03 (patch) | |
tree | b0c51fd12e2be808dbefea19b6fe5b6f28b57e6c | |
parent | 952d2cdb56cb997b2158d363d8db3ee11fd49d11 (diff) |
rework an ugly hack in processPaymentRequest()
- use a QStringList to store valid addresses and format them for GUI and
debug.log usage via .join()
-rw-r--r-- | src/qt/paymentserver.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 71a5bb4550..b6c869a2c9 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -453,16 +453,14 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins request.getMerchant(PaymentServer::certStore, recipient.authenticatedMerchant); QList<std::pair<CScript, qint64> > sendingTos = request.getPayTo(); + QStringList addresses; - int i = 0; foreach(const PAIRTYPE(CScript, qint64)& sendingTo, sendingTos) { // Extract and check destination addresses CTxDestination dest; if (ExtractDestination(sendingTo.first, dest)) { - // Append destination address (for payment requests .address is used ONLY for GUI display) - recipient.address.append(QString::fromStdString(CBitcoinAddress(dest).ToString())); - if (i < sendingTos.size() - 1) // prevent new-line for last entry - recipient.address.append("<br />"); + // Append destination address + addresses.append(QString::fromStdString(CBitcoinAddress(dest).ToString())); } else if (!recipient.authenticatedMerchant.isEmpty()){ // Insecure payments to custom bitcoin addresses are not supported @@ -486,7 +484,6 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins } recipient.amount += sendingTo.second; - i++; } // Store addresses and format them to fit nicely into the GUI recipient.address = addresses.join("<br />"); |