cleanup transaction tab
This commit is contained in:
@@ -644,19 +644,17 @@ void Controller::refreshTransactions() {
|
|||||||
for (auto o: it["outgoing_metadata"].get<json::array_t>()) {
|
for (auto o: it["outgoing_metadata"].get<json::array_t>()) {
|
||||||
|
|
||||||
QString address;
|
QString address;
|
||||||
if (CAmount::fromqint64(!o["value"].get<json::number_unsigned_t>())==0 ) {
|
|
||||||
address = QString::fromStdString(o["address"]);
|
address = QString::fromStdString(o["address"]);
|
||||||
}else{ address = "";}
|
|
||||||
|
|
||||||
// Sent items are -ve
|
// Sent items are -ve
|
||||||
CAmount amount = CAmount::fromqint64(-1 * o["value"].get<json::number_unsigned_t>());
|
CAmount amount = CAmount::fromqint64(-1* o["value"].get<json::number_unsigned_t>());
|
||||||
|
|
||||||
// Check for Memos
|
// Check for Memos
|
||||||
|
|
||||||
QString memo;
|
QString memo;
|
||||||
if (!o["memo"].is_null()) {
|
if (!o["memo"].is_null()) {
|
||||||
memo = QString::fromStdString(o["memo"]);
|
memo = QString::fromStdString(o["memo"]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push_back(TransactionItemDetail{address, amount, memo});
|
items.push_back(TransactionItemDetail{address, amount, memo});
|
||||||
@@ -669,13 +667,16 @@ void Controller::refreshTransactions() {
|
|||||||
QList<QString> addresses;
|
QList<QString> addresses;
|
||||||
for (auto item : items) {
|
for (auto item : items) {
|
||||||
|
|
||||||
|
if (item.amount == 0 ) {
|
||||||
|
|
||||||
addresses.push_back(item.address);
|
} else {
|
||||||
|
addresses.push_back(item.address);
|
||||||
|
|
||||||
address = addresses.join(",");
|
address = addresses.join(","); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}
|
||||||
|
|
||||||
txdata.push_back(TransactionItem{
|
txdata.push_back(TransactionItem{
|
||||||
"send", datetime, address, txid,confirmations, items
|
"send", datetime, address, txid,confirmations, items
|
||||||
|
|||||||
Reference in New Issue
Block a user