Browse Source

#91 Store sent Tx address, handle multiple sent addresses case.

pull/45/head
Aditya Kulkarni 5 years ago
parent
commit
e47d3b5a35
  1. 12
      src/senttxstore.cpp

12
src/senttxstore.cpp

@ -84,12 +84,22 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) {
totalAmount += i.amount;
}
QString toAddresses;
if (tx.toAddrs.length() == 1) {
toAddresses = tx.toAddrs[0].addr;
} else {
// Concatenate all the toAddresses
for (auto a : tx.toAddrs) {
toAddresses += a.addr % "(" % Settings::getZECDisplayFormat(a.amount) % ") ";
}
}
auto list = jsonDoc.array();
QJsonObject txItem;
txItem["type"] = "sent";
txItem["from"] = tx.fromAddr;
txItem["datetime"] = QDateTime::currentMSecsSinceEpoch() / (qint64)1000;
txItem["address"] = QString(); // The sent address is blank, to be consistent with t-Addr sent behaviour
txItem["address"] = toAddresses;
txItem["txid"] = txid;
txItem["amount"] = -totalAmount;
txItem["fee"] = -tx.fee;

Loading…
Cancel
Save