mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-19 08:08:39 +02:00
move get_tx_notes down
This commit is contained in:
@@ -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<const crypto::hash*>(tx_blob.data());
|
||||
return m_w2->get_tx_note(tx_hash);
|
||||
}
|
||||
|
||||
vector<string> monero_wallet::get_tx_notes(const vector<string>& m_tx_ids) const {
|
||||
MTRACE("monero_wallet::get_tx_notes()");
|
||||
vector<string> 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<const crypto::hash*>(tx_blob.data());
|
||||
m_w2->set_tx_note(tx_hash, note);
|
||||
}
|
||||
|
||||
void monero_wallet::set_tx_notes(const vector<string>& m_tx_ids, const vector<string>& 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<const crypto::hash*>(tx_blob.data());
|
||||
return m_w2->get_tx_note(tx_hash);
|
||||
}
|
||||
|
||||
vector<string> monero_wallet::get_tx_notes(const vector<string>& m_tx_ids) const {
|
||||
MTRACE("monero_wallet::get_tx_notes()");
|
||||
vector<string> 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<const crypto::hash*>(tx_blob.data());
|
||||
m_w2->set_tx_note(tx_hash, note);
|
||||
}
|
||||
|
||||
void monero_wallet::set_tx_notes(const vector<string>& m_tx_ids, const vector<string>& 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()");
|
||||
|
||||
|
||||
+32
-32
@@ -991,38 +991,6 @@ namespace monero {
|
||||
*/
|
||||
vector<shared_ptr<monero_tx_wallet>> 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<string> get_tx_notes(const vector<string>& 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<string>& tx_ids, const vector<string>& notes);
|
||||
|
||||
/**
|
||||
* Sign a message.
|
||||
*
|
||||
@@ -1144,6 +1112,38 @@ namespace monero {
|
||||
*/
|
||||
shared_ptr<monero_check_reserve> 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<string> get_tx_notes(const vector<string>& 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<string>& tx_ids, const vector<string>& notes);
|
||||
|
||||
// /**
|
||||
// * Get all address book entries.
|
||||
// *
|
||||
|
||||
Reference in New Issue
Block a user