aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r--src/wallet/wallet2.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 3dc215601..2fbe05f89 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -49,7 +49,7 @@
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_core/cryptonote_tx_utils.h"
#include "common/unordered_containers_boost_serialization.h"
-#include "crypto/chacha8.h"
+#include "crypto/chacha.h"
#include "crypto/hash.h"
#include "ringct/rctTypes.h"
#include "ringct/rctOps.h"
@@ -404,7 +404,7 @@ namespace tools
struct keys_file_data
{
- crypto::chacha8_iv iv;
+ crypto::chacha_iv iv;
std::string account_data;
BEGIN_SERIALIZE_OBJECT()
@@ -415,7 +415,7 @@ namespace tools
struct cache_file_data
{
- crypto::chacha8_iv iv;
+ crypto::chacha_iv iv;
std::string cache_data;
BEGIN_SERIALIZE_OBJECT()
@@ -777,6 +777,9 @@ namespace tools
if(ver < 22)
return;
a & m_unconfirmed_payments;
+ if(ver < 23)
+ return;
+ a & m_account_tags;
}
/*!
@@ -873,6 +876,24 @@ namespace tools
void set_description(const std::string &description);
std::string get_description() const;
+ /*!
+ * \brief Get the list of registered account tags.
+ * \return first.Key=(tag's name), first.Value=(tag's label), second[i]=(i-th account's tag)
+ */
+ const std::pair<std::map<std::string, std::string>, std::vector<std::string>>& get_account_tags();
+ /*!
+ * \brief Set a tag to the given accounts.
+ * \param account_indices Indices of accounts.
+ * \param tag Tag's name. If empty, the accounts become untagged.
+ */
+ void set_account_tag(const std::set<uint32_t> account_indices, const std::string& tag);
+ /*!
+ * \brief Set the label of the given tag.
+ * \param tag Tag's name (which must be non-empty).
+ * \param label Tag's description.
+ */
+ void set_account_tag_description(const std::string& tag, const std::string& description);
+
std::string sign(const std::string &data) const;
bool verify(const std::string &data, const cryptonote::account_public_address &address, const std::string &signature) const;
@@ -985,7 +1006,7 @@ namespace tools
void add_unconfirmed_tx(const cryptonote::transaction& tx, uint64_t amount_in, const std::vector<cryptonote::tx_destination_entry> &dests, const crypto::hash &payment_id, uint64_t change_amount, uint32_t subaddr_account, const std::set<uint32_t>& subaddr_indices);
void generate_genesis(cryptonote::block& b);
void check_genesis(const crypto::hash& genesis_hash) const; //throws
- bool generate_chacha8_key_from_secret_keys(crypto::chacha8_key &key) const;
+ bool generate_chacha_key_from_secret_keys(crypto::chacha_key &key) const;
crypto::hash get_payment_id(const pending_tx &ptx) const;
void check_acc_out_precomp(const cryptonote::tx_out &o, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, size_t i, tx_scan_info_t &tx_scan_info) const;
void parse_block_round(const cryptonote::blobdata &blob, cryptonote::block &bl, crypto::hash &bl_id, bool &error) const;
@@ -1035,6 +1056,7 @@ namespace tools
std::unordered_map<crypto::hash, std::string> m_tx_notes;
std::unordered_map<std::string, std::string> m_attributes;
std::vector<tools::wallet2::address_book_row> m_address_book;
+ std::pair<std::map<std::string, std::string>, std::vector<std::string>> m_account_tags;
uint64_t m_upper_transaction_size_limit; //TODO: auto-calc this value or request from daemon, now use some fixed value
const std::vector<std::vector<tools::wallet2::multisig_info>> *m_multisig_rescan_info;
const std::vector<std::vector<rct::key>> *m_multisig_rescan_k;
@@ -1087,7 +1109,7 @@ namespace tools
std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
};
}
-BOOST_CLASS_VERSION(tools::wallet2, 22)
+BOOST_CLASS_VERSION(tools::wallet2, 23)
BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 9)
BOOST_CLASS_VERSION(tools::wallet2::multisig_info, 1)
BOOST_CLASS_VERSION(tools::wallet2::multisig_info::LR, 0)