mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
Merge pull request #6829
016f36a
Allow tx note edits via TransactionHistory object in wallet/api (dsc)
This commit is contained in:
commit
9b743e7c36
3 changed files with 13 additions and 0 deletions
|
@ -92,6 +92,17 @@ std::vector<TransactionInfo *> TransactionHistoryImpl::getAll() const
|
||||||
return m_history;
|
return m_history;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransactionHistoryImpl::setTxNote(const std::string &txid, const std::string ¬e)
|
||||||
|
{
|
||||||
|
cryptonote::blobdata txid_data;
|
||||||
|
if(!epee::string_tools::parse_hexstr_to_binbuff(txid, txid_data) || txid_data.size() != sizeof(crypto::hash))
|
||||||
|
return;
|
||||||
|
const crypto::hash htxid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
|
||||||
|
|
||||||
|
m_wallet->m_wallet->set_tx_note(htxid, note);
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void TransactionHistoryImpl::refresh()
|
void TransactionHistoryImpl::refresh()
|
||||||
{
|
{
|
||||||
// multithreaded access:
|
// multithreaded access:
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
virtual TransactionInfo * transaction(const std::string &id) const;
|
virtual TransactionInfo * transaction(const std::string &id) const;
|
||||||
virtual std::vector<TransactionInfo*> getAll() const;
|
virtual std::vector<TransactionInfo*> getAll() const;
|
||||||
virtual void refresh();
|
virtual void refresh();
|
||||||
|
virtual void setTxNote(const std::string &txid, const std::string ¬e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,7 @@ struct TransactionHistory
|
||||||
virtual TransactionInfo * transaction(const std::string &id) const = 0;
|
virtual TransactionInfo * transaction(const std::string &id) const = 0;
|
||||||
virtual std::vector<TransactionInfo*> getAll() const = 0;
|
virtual std::vector<TransactionInfo*> getAll() const = 0;
|
||||||
virtual void refresh() = 0;
|
virtual void refresh() = 0;
|
||||||
|
virtual void setTxNote(const std::string &txid, const std::string ¬e) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue