aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 4838395cd..b02884f67 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1971,6 +1971,30 @@ bool WalletImpl::getRing(const std::string &key_image, std::vector<uint64_t> &ri
return true;
}
+bool WalletImpl::getRings(const std::string &txid, std::vector<std::pair<std::string, std::vector<uint64_t>>> &rings) const
+{
+ crypto::hash raw_txid;
+ if (!epee::string_tools::hex_to_pod(txid, raw_txid))
+ {
+ m_status = Status_Error;
+ m_errorString = tr("Failed to parse txid");
+ return false;
+ }
+ std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> raw_rings;
+ bool ret = m_wallet->get_rings(raw_txid, raw_rings);
+ if (!ret)
+ {
+ m_status = Status_Error;
+ m_errorString = tr("Failed to get rings");
+ return false;
+ }
+ for (const auto &r: raw_rings)
+ {
+ rings.push_back(std::make_pair(epee::string_tools::pod_to_hex(r.first), r.second));
+ }
+ return true;
+}
+
bool WalletImpl::setRing(const std::string &key_image, const std::vector<uint64_t> &ring, bool relative)
{
crypto::key_image raw_key_image;