history: use subaddress label as default tx description

This commit is contained in:
tobtoht 2023-12-22 16:08:46 +01:00
parent 46e0215953
commit af4259a2bd
No known key found for this signature in database
GPG key ID: E45B10DD027D2472

View file

@ -97,7 +97,6 @@ void TransactionHistory::refresh()
t->m_direction = TransactionRow::Direction_In;
t->m_hash = QString::fromStdString(epee::string_tools::pod_to_hex(pd.m_tx_hash));
t->m_blockHeight = pd.m_block_height;
t->m_description = QString::fromStdString(m_wallet2->get_tx_note(pd.m_tx_hash));
t->m_subaddrIndex = { pd.m_subaddr_index.minor };
t->m_subaddrAccount = pd.m_subaddr_index.major;
t->m_label = QString::fromStdString(m_wallet2->get_subaddress_label(pd.m_subaddr_index));
@ -105,6 +104,11 @@ void TransactionHistory::refresh()
t->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
t->m_unlockTime = pd.m_unlock_time;
t->m_description = QString::fromStdString(m_wallet2->get_tx_note(pd.m_tx_hash));
if (t->m_description.isEmpty()) {
t->m_description = QString::fromStdString(m_wallet2->get_subaddress_label(pd.m_subaddr_index));
}
m_rows.append(t);
}
@ -244,7 +248,6 @@ void TransactionHistory::refresh()
t->m_direction = TransactionRow::Direction_In;
t->m_hash = QString::fromStdString(epee::string_tools::pod_to_hex(pd.m_tx_hash));
t->m_blockHeight = pd.m_block_height;
t->m_description = QString::fromStdString(m_wallet2->get_tx_note(pd.m_tx_hash));
t->m_pending = true;
t->m_subaddrIndex = { pd.m_subaddr_index.minor };
t->m_subaddrAccount = pd.m_subaddr_index.major;
@ -252,6 +255,11 @@ void TransactionHistory::refresh()
t->m_timestamp = QDateTime::fromSecsSinceEpoch(pd.m_timestamp);
t->m_confirmations = 0;
t->m_description = QString::fromStdString(m_wallet2->get_tx_note(pd.m_tx_hash));
if (t->m_description.isEmpty()) {
t->m_description = QString::fromStdString(m_wallet2->get_subaddress_label(pd.m_subaddr_index));
}
m_rows.append(t);
LOG_PRINT_L1(__FUNCTION__ << ": Unconfirmed payment found " << pd.m_amount);