diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-07-11 23:14:58 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:29:24 +0100 |
commit | e81a2b2cfabfb1ad9aaade752a863f1448fc89cd (patch) | |
tree | db73ec65efcabf1d6d0d9dacda8de58b325d006c /src/wallet/wallet_rpc_server.cpp | |
parent | tests: add basic tests for simple rct api (diff) | |
download | monero-e81a2b2cfabfb1ad9aaade752a863f1448fc89cd.tar.xz |
port get_tx_key/check_tx_key to rct
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 9bcc26077..7d00dde08 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -254,7 +254,16 @@ namespace tools // populate response with tx hash res.tx_hash = epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx_vector.back().tx)); if (req.get_tx_key) + { res.tx_key = epee::string_tools::pod_to_hex(ptx_vector.back().tx_key); + if (ptx_vector.back().tx.version > 1) + { + for (const auto &i: ptx_vector.back().amount_keys) + { + res.amount_keys.push_back(epee::string_tools::pod_to_hex(i)); + } + } + } return true; } catch (const tools::error::daemon_busy& e) @@ -317,7 +326,17 @@ namespace tools { res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx))); if (req.get_tx_keys) + { res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key)); + res.amount_key_list.push_back(wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT::key_list()); + if (ptx.tx.version > 1) + { + for (const auto &i: ptx.amount_keys) + { + res.amount_key_list.back().keys.push_back(epee::string_tools::pod_to_hex(i)); + } + } + } } return true; @@ -363,7 +382,17 @@ namespace tools { res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx))); if (req.get_tx_keys) + { res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key)); + res.amount_key_list.push_back(wallet_rpc::COMMAND_RPC_SWEEP_DUST::key_list()); + if (ptx.tx.version > 1) + { + for (const auto &i: ptx.amount_keys) + { + res.amount_key_list.back().keys.push_back(epee::string_tools::pod_to_hex(i)); + } + } + } } return true; @@ -422,7 +451,17 @@ namespace tools { res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx))); if (req.get_tx_keys) + { res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key)); + res.amount_key_list.push_back(wallet_rpc::COMMAND_RPC_SWEEP_ALL::key_list()); + if (ptx.tx.version > 1) + { + for (const auto &i: ptx.amount_keys) + { + res.amount_key_list.back().keys.push_back(epee::string_tools::pod_to_hex(i)); + } + } + } } return true; |