From bd20e8874322dbc408f0c87037ac78ace80cf8ac Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 5 Jan 2020 12:40:50 +0100 Subject: [PATCH] cleanup transaction tab --- src/controller.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index 9d4ba8f..d6fdef5 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -644,19 +644,17 @@ void Controller::refreshTransactions() { for (auto o: it["outgoing_metadata"].get()) { QString address; - if (CAmount::fromqint64(!o["value"].get())==0 ) { - address = QString::fromStdString(o["address"]); - }else{ address = "";} + + address = QString::fromStdString(o["address"]); // Sent items are -ve - CAmount amount = CAmount::fromqint64(-1 * o["value"].get()); + CAmount amount = CAmount::fromqint64(-1* o["value"].get()); // Check for Memos QString memo; if (!o["memo"].is_null()) { memo = QString::fromStdString(o["memo"]); - } items.push_back(TransactionItemDetail{address, amount, memo}); @@ -669,13 +667,16 @@ void Controller::refreshTransactions() { QList addresses; for (auto item : items) { - - addresses.push_back(item.address); + if (item.amount == 0 ) { - address = addresses.join(","); - + } else { + addresses.push_back(item.address); + + address = addresses.join(","); } - }} + } + + } txdata.push_back(TransactionItem{ "send", datetime, address, txid,confirmations, items