support setting account and subaddress labels

This commit is contained in:
woodser
2023-04-02 16:08:29 -04:00
parent 33d73f6964
commit 359ccae595
3 changed files with 18 additions and 0 deletions
+11
View File
@@ -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.
+6
View File
@@ -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<std::shared_ptr<monero_tx_wallet>> monero_wallet_full::get_txs() const {
return get_txs(monero_tx_query());
}
+1
View File
@@ -233,6 +233,7 @@ namespace monero {
monero_account create_account(const std::string& label = "") override;
std::vector<monero_subaddress> get_subaddresses(const uint32_t account_idx, const std::vector<uint32_t>& 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<std::shared_ptr<monero_tx_wallet>> get_txs() const override;
std::vector<std::shared_ptr<monero_tx_wallet>> get_txs(const monero_tx_query& query) const override;
std::vector<std::shared_ptr<monero_tx_wallet>> get_txs(const monero_tx_query& query, std::vector<std::string>& missing_tx_hashes) const override;