From 83bbea4c7f47d05933ec1b5baca2e9724561e49c Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 11 Aug 2015 10:49:15 +0100 Subject: Add a is_key_image_spent daemon command and RPC call --- src/daemon/command_parser_executor.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/daemon/command_parser_executor.cpp') 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 return true; } +bool t_command_parser_executor::is_key_image_spent(const std::vector& args) +{ + if (args.empty()) + { + std::cout << "expected: is_key_image_spent " << 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& args) { if (!args.empty()) return false; -- cgit v1.2.3