aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-11 10:49:15 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-11 10:52:41 +0100
commit83bbea4c7f47d05933ec1b5baca2e9724561e49c (patch)
treeacc999b802091f32227e66e677ae483398fe1d93 /src/daemon/command_parser_executor.cpp
parentblockchain: remove dead code (diff)
downloadmonero-83bbea4c7f47d05933ec1b5baca2e9724561e49c.tar.xz
Add a is_key_image_spent daemon command and RPC call
Diffstat (limited to '')
-rw-r--r--src/daemon/command_parser_executor.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index 58cb475ab..e6666c443 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -180,6 +180,26 @@ bool t_command_parser_executor::print_transaction(const std::vector<std::string>
return true;
}
+bool t_command_parser_executor::is_key_image_spent(const std::vector<std::string>& args)
+{
+ if (args.empty())
+ {
+ std::cout << "expected: is_key_image_spent <key_image>" << std::endl;
+ return true;
+ }
+
+ const std::string& str = args.front();
+ crypto::key_image ki;
+ crypto::hash hash;
+ if (parse_hash256(str, hash))
+ {
+ memcpy(&ki, &hash, sizeof(ki));
+ m_executor.is_key_image_spent(ki);
+ }
+
+ return true;
+}
+
bool t_command_parser_executor::print_transaction_pool_long(const std::vector<std::string>& args)
{
if (!args.empty()) return false;