diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index e241f8a..018b48a 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -2158,41 +2158,6 @@ namespace monero { return txs; } - string monero_wallet::get_tx_note(const string& tx_id) const { - MTRACE("monero_wallet::get_tx_note()"); - cryptonote::blobdata tx_blob; - if (!epee::string_tools::parse_hexstr_to_binbuff(tx_id, tx_blob) || tx_blob.size() != sizeof(crypto::hash)) { - throw runtime_error("TX ID has invalid format"); - } - crypto::hash tx_hash = *reinterpret_cast(tx_blob.data()); - return m_w2->get_tx_note(tx_hash); - } - - vector monero_wallet::get_tx_notes(const vector& m_tx_ids) const { - MTRACE("monero_wallet::get_tx_notes()"); - vector notes; - for (const auto& tx_id : m_tx_ids) notes.push_back(get_tx_note(tx_id)); - return notes; - } - - void monero_wallet::set_tx_note(const string& tx_id, const string& note) { - MTRACE("monero_wallet::set_tx_note()"); - cryptonote::blobdata tx_blob; - if (!epee::string_tools::parse_hexstr_to_binbuff(tx_id, tx_blob) || tx_blob.size() != sizeof(crypto::hash)) { - throw runtime_error("TX ID has invalid format"); - } - crypto::hash tx_hash = *reinterpret_cast(tx_blob.data()); - m_w2->set_tx_note(tx_hash, note); - } - - void monero_wallet::set_tx_notes(const vector& m_tx_ids, const vector& notes) { - MTRACE("monero_wallet::set_tx_notes()"); - if (m_tx_ids.size() != notes.size()) throw runtime_error("Different amount of txids and notes"); - for (int i = 0; i < m_tx_ids.size(); i++) { - set_tx_note(m_tx_ids[i], notes[i]); - } - } - string monero_wallet::sign(const string& msg) const { return m_w2->sign(msg); } @@ -2404,6 +2369,41 @@ namespace monero { return checkReserve; } + string monero_wallet::get_tx_note(const string& tx_id) const { + MTRACE("monero_wallet::get_tx_note()"); + cryptonote::blobdata tx_blob; + if (!epee::string_tools::parse_hexstr_to_binbuff(tx_id, tx_blob) || tx_blob.size() != sizeof(crypto::hash)) { + throw runtime_error("TX ID has invalid format"); + } + crypto::hash tx_hash = *reinterpret_cast(tx_blob.data()); + return m_w2->get_tx_note(tx_hash); + } + + vector monero_wallet::get_tx_notes(const vector& m_tx_ids) const { + MTRACE("monero_wallet::get_tx_notes()"); + vector notes; + for (const auto& tx_id : m_tx_ids) notes.push_back(get_tx_note(tx_id)); + return notes; + } + + void monero_wallet::set_tx_note(const string& tx_id, const string& note) { + MTRACE("monero_wallet::set_tx_note()"); + cryptonote::blobdata tx_blob; + if (!epee::string_tools::parse_hexstr_to_binbuff(tx_id, tx_blob) || tx_blob.size() != sizeof(crypto::hash)) { + throw runtime_error("TX ID has invalid format"); + } + crypto::hash tx_hash = *reinterpret_cast(tx_blob.data()); + m_w2->set_tx_note(tx_hash, note); + } + + void monero_wallet::set_tx_notes(const vector& m_tx_ids, const vector& notes) { + MTRACE("monero_wallet::set_tx_notes()"); + if (m_tx_ids.size() != notes.size()) throw runtime_error("Different amount of txids and notes"); + for (int i = 0; i < m_tx_ids.size(); i++) { + set_tx_note(m_tx_ids[i], notes[i]); + } + } + string monero_wallet::create_payment_uri(const monero_send_request& request) const { MTRACE("create_payment_uri()"); diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 8588901..9713f71 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -991,38 +991,6 @@ namespace monero { */ vector> sweep_dust(bool do_not_relay = false); - /** - * Get a transaction note. - * - * @param tx_id specifies the transaction to get the note of - * @return the tx note - */ - string get_tx_note(const string& tx_id) const; - - /** - * Get notes for multiple transactions. - * - * @param tx_ids identify the transactions to get notes for - * @preturns notes for the transactions - */ - vector get_tx_notes(const vector& tx_ids) const; - - /** - * Set a note for a specific transaction. - * - * @param tx_id specifies the transaction - * @param note specifies the note - */ - void set_tx_note(const string& tx_id, const string& note); - - /** - * Set notes for multiple transactions. - * - * @param tx_ids specify the transactions to set notes for - * @param notes are the notes to set for the transactions - */ - void set_tx_notes(const vector& tx_ids, const vector& notes); - /** * Sign a message. * @@ -1144,6 +1112,38 @@ namespace monero { */ shared_ptr check_reserve_proof(const string& address, const string& message, const string& signature) const; + /** + * Get a transaction note. + * + * @param tx_id specifies the transaction to get the note of + * @return the tx note + */ + string get_tx_note(const string& tx_id) const; + + /** + * Get notes for multiple transactions. + * + * @param tx_ids identify the transactions to get notes for + * @preturns notes for the transactions + */ + vector get_tx_notes(const vector& tx_ids) const; + + /** + * Set a note for a specific transaction. + * + * @param tx_id specifies the transaction + * @param note specifies the note + */ + void set_tx_note(const string& tx_id, const string& note); + + /** + * Set notes for multiple transactions. + * + * @param tx_ids specify the transactions to set notes for + * @param notes are the notes to set for the transactions + */ + void set_tx_notes(const vector& tx_ids, const vector& notes); + // /** // * Get all address book entries. // *