aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-05 20:53:45 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-05 21:19:08 +0000
commit97288a5ce21cedc6d040fe2f7b858e3a1736dc6e (patch)
treecc68df1e7d39fb253d5a5497361c07e169a6e740 /src/wallet/api/wallet.cpp
parentMerge pull request #1272 (diff)
downloadmonero-97288a5ce21cedc6d040fe2f7b858e3a1736dc6e.tar.xz
wallet2_api: add API for tx notes
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 9a9638b40..7227b6b4d 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -707,6 +707,26 @@ void WalletImpl::setDefaultMixin(uint32_t arg)
m_wallet->default_mixin(arg);
}
+bool WalletImpl::setUserNote(const std::string &txid, const std::string &note)
+{
+ cryptonote::blobdata txid_data;
+ if(!epee::string_tools::parse_hexstr_to_binbuff(txid, txid_data))
+ return false;
+ const crypto::hash htxid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
+
+ m_wallet->set_tx_note(htxid, note);
+ return true;
+}
+
+std::string WalletImpl::getUserNote(const std::string &txid) const
+{
+ cryptonote::blobdata txid_data;
+ if(!epee::string_tools::parse_hexstr_to_binbuff(txid, txid_data))
+ return "";
+ const crypto::hash htxid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
+
+ return m_wallet->get_tx_note(htxid);
+}
bool WalletImpl::connectToDaemon()
{