aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorrbrunner7 <rbrunner@dreamshare.ch>2017-10-08 09:15:06 +0200
committerrbrunner7 <rbrunner@dreamshare.ch>2017-10-16 22:24:09 +0200
commitb370ef54b953b7ca900b74de3dff36216063cc8a (patch)
tree6289fbd4600a3875a073817c22d84b124ec7d04c /src/wallet/wallet2.cpp
parentMerge pull request #2601 (diff)
downloadmonero-b370ef54b953b7ca900b74de3dff36216063cc8a.tar.xz
Wallet: Descriptions through new commands 'set_description', 'get_description'
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index cc0e9e7e2..2e05b1484 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -6248,6 +6248,29 @@ std::string wallet2::get_tx_note(const crypto::hash &txid) const
return i->second;
}
+void wallet2::set_attribute(const std::string &key, const std::string &value)
+{
+ m_attributes[key] = value;
+}
+
+std::string wallet2::get_attribute(const std::string &key) const
+{
+ std::unordered_map<std::string, std::string>::const_iterator i = m_attributes.find(key);
+ if (i == m_attributes.end())
+ return std::string();
+ return i->second;
+}
+
+void wallet2::set_description(const std::string &description)
+{
+ set_attribute(ATTRIBUTE_DESCRIPTION, description);
+}
+
+std::string wallet2::get_description() const
+{
+ return get_attribute(ATTRIBUTE_DESCRIPTION);
+}
+
std::string wallet2::sign(const std::string &data) const
{
crypto::hash hash;