From 395d0d5af017bbf6d432471075608efaf4104a03 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 30 Oct 2013 11:26:44 +0100 Subject: rework an ugly hack in processPaymentRequest() - use a QStringList to store valid addresses and format them for GUI and debug.log usage via .join() --- src/qt/paymentserver.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/qt/paymentserver.cpp') 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 > 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("
"); + // 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("
"); -- cgit v1.2.3