diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:45:54 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:45:54 +0200 |
commit | af2ceb29fa5c569714b12d97a206759d5184ee78 (patch) | |
tree | 42589e81c1e9422a8fd4a069ee22e7458407ecf0 /src/wallet/api/wallet.cpp | |
parent | Merge pull request #1297 (diff) | |
parent | wallet2_api: add API for tx notes (diff) | |
download | monero-af2ceb29fa5c569714b12d97a206759d5184ee78.tar.xz |
Merge pull request #1298
97288a5 wallet2_api: add API for tx notes (moneromooo-monero)
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r-- | src/wallet/api/wallet.cpp | 20 |
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 ¬e) +{ + 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() { |