]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
coins: prefer tx label
authortobtoht <tob@featherwallet.org>
Mon, 1 Jan 2024 16:58:59 +0000 (17:58 +0100)
committertobtoht <tob@featherwallet.org>
Mon, 1 Jan 2024 16:58:59 +0000 (17:58 +0100)
src/libwalletqt/Coins.cpp
src/libwalletqt/rows/CoinsInfo.cpp
src/libwalletqt/rows/CoinsInfo.h
src/model/CoinsModel.cpp

index aefe5571b0e383b6de938ecb4a0590323fe701ce..d40d72c9db40235730402d03089b4131cd5faadf 100644 (file)
@@ -68,6 +68,7 @@ void Coins::refresh()
             ci->m_subaddrAccount = td.m_subaddr_index.major;
             ci->m_address = QString::fromStdString(m_wallet2->get_subaddress_as_str(td.m_subaddr_index)); // todo: this is expensive, cache maybe?
             ci->m_addressLabel = QString::fromStdString(m_wallet2->get_subaddress_label(td.m_subaddr_index));
+            ci->m_txNote = QString::fromStdString(m_wallet2->get_tx_note(td.m_txid));
             ci->m_keyImage = QString::fromStdString(epee::string_tools::pod_to_hex(td.m_key_image));
             ci->m_unlockTime = td.m_tx.unlock_time;
             ci->m_unlocked = m_wallet2->is_transfer_unlocked(td);
index 2c00364877dfadbb0b921e53a5201cb66a8d7867..4f1fa9695a0f01788b6cc1180c673252b906033a 100644 (file)
@@ -120,6 +120,10 @@ bool CoinsInfo::change() const {
     return m_change;
 }
 
+QString CoinsInfo::txNote() const {
+    return m_txNote;
+}
+
 CoinsInfo::CoinsInfo(QObject *parent)
         : QObject(parent)
         , m_blockHeight(0)
index a68fd1bc28f72c9315df2e58d832a3179a85ea42..7999b370011a72b5ceab15a5ced387d33b555ad0 100644 (file)
@@ -39,6 +39,7 @@ public:
     bool coinbase() const;
     QString description() const;
     bool change() const;
+    QString txNote() const;
 
     void setUnlocked(bool unlocked);
 
@@ -70,6 +71,7 @@ private:
     bool m_coinbase;
     QString m_description;
     bool m_change;
+    QString m_txNote;
 };
 
 #endif //FEATHER_COINSINFO_H
index 27bb1dff09fa83db84958ab35802967af7a330c4..6142660b112825c831ba9c83c283bec2d0a83514 100644 (file)
@@ -228,6 +228,8 @@ QVariant CoinsModel::parseTransactionInfo(const CoinsInfo &cInfo, int column, in
         case Label: {
             if (!cInfo.description().isEmpty())
                 return cInfo.description();
+            if (!cInfo.txNote().isEmpty())
+                return cInfo.txNote();
             return cInfo.addressLabel();
         }
         case Spent: