diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 5fcda7a..094c093 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -689,6 +689,17 @@ namespace monero { throw std::runtime_error("create_subaddress() not supported"); } + /** + * Set a subaddress label. + * + * @param account_idx index of the account to set the label for + * @param subaddressIdx index of the subaddress to set the label for + * @param label the label to set + */ + virtual void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string& label = "") { + throw std::runtime_error("set_subaddress_label() not supported"); + } + /** * Get all wallet transactions. Wallet transactions contain one or more * transfers that are either incoming or outgoing to the wallet. diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index e6c394f..8068288 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -1706,6 +1706,12 @@ namespace monero { return subaddress; } + void monero_wallet_full::set_subaddress_label(const uint32_t account_idx, const uint32_t subaddress_idx, const std::string& label) { + MTRACE("set_subaddress_label(" << account_idx << ", " << subaddress_idx << ", " << label << ")"); + cryptonote::subaddress_index index = {account_idx, subaddress_idx}; + m_w2->set_subaddress_label(index, label); + } + std::vector> monero_wallet_full::get_txs() const { return get_txs(monero_tx_query()); } diff --git a/src/wallet/monero_wallet_full.h b/src/wallet/monero_wallet_full.h index 3257fdd..0217fca 100644 --- a/src/wallet/monero_wallet_full.h +++ b/src/wallet/monero_wallet_full.h @@ -233,6 +233,7 @@ namespace monero { monero_account create_account(const std::string& label = "") override; std::vector get_subaddresses(const uint32_t account_idx, const std::vector& subaddress_indices) const override; monero_subaddress create_subaddress(uint32_t account_idx, const std::string& label = "") override; + void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string& label = "") override; std::vector> get_txs() const override; std::vector> get_txs(const monero_tx_query& query) const override; std::vector> get_txs(const monero_tx_query& query, std::vector& missing_tx_hashes) const override;