aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/transaction_history.cpp
diff options
context:
space:
mode:
authordsc <dsc@xmr.pm>2020-09-19 21:43:18 +0200
committerluigi1111 <luigi1111w@gmail.com>2020-11-28 21:48:57 -0600
commitd15719641645c1f410c697f9151fdda146946ef1 (patch)
tree5af8cfbf09510006ef45da4e5a8bb8ecf6633d2f /src/wallet/api/transaction_history.cpp
parentMerge pull request #6826 (diff)
downloadmonero-d15719641645c1f410c697f9151fdda146946ef1.tar.xz
Allow tx note edits via TransactionHistory object in wallet/api
Diffstat (limited to 'src/wallet/api/transaction_history.cpp')
-rw-r--r--src/wallet/api/transaction_history.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp
index bcb300889..8bb15f39a 100644
--- a/src/wallet/api/transaction_history.cpp
+++ b/src/wallet/api/transaction_history.cpp
@@ -92,6 +92,17 @@ std::vector<TransactionInfo *> TransactionHistoryImpl::getAll() const
return m_history;
}
+void TransactionHistoryImpl::setTxNote(const std::string &txid, const std::string &note)
+{
+ cryptonote::blobdata txid_data;
+ if(!epee::string_tools::parse_hexstr_to_binbuff(txid, txid_data) || txid_data.size() != sizeof(crypto::hash))
+ return;
+ const crypto::hash htxid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
+
+ m_wallet->m_wallet->set_tx_note(htxid, note);
+ refresh();
+}
+
void TransactionHistoryImpl::refresh()
{
// multithreaded access: