From d91eb8c7b43fc73b9333de800500f217e370cc4b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 19 Aug 2015 20:59:44 +0100 Subject: wallet: only return tx keys via RPC if requested To get the tx keys returned via RPC, set the "get_tx_key" or "get_tx_keys" request field to true (defaults to false). --- src/wallet/wallet_rpc_server.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/wallet/wallet_rpc_server.cpp') diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 0682f7743..a3b468505 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -218,7 +218,8 @@ namespace tools // populate response with tx hash res.tx_hash = boost::lexical_cast(cryptonote::get_transaction_hash(ptx_vector.back().tx)); - res.tx_key = boost::lexical_cast(ptx_vector.back().tx_key); + if (req.get_tx_key) + res.tx_key = boost::lexical_cast(ptx_vector.back().tx_key); return true; } catch (const tools::error::daemon_busy& e) @@ -275,7 +276,8 @@ namespace tools for (auto & ptx : ptx_vector) { res.tx_hash_list.push_back(boost::lexical_cast(cryptonote::get_transaction_hash(ptx.tx))); - res.tx_key_list.push_back(boost::lexical_cast(ptx.tx_key)); + if (req.get_tx_keys) + res.tx_key_list.push_back(boost::lexical_cast(ptx.tx_key)); } return true; @@ -320,7 +322,8 @@ namespace tools for (auto & ptx : ptx_vector) { res.tx_hash_list.push_back(boost::lexical_cast(cryptonote::get_transaction_hash(ptx.tx))); - res.tx_key_list.push_back(boost::lexical_cast(ptx.tx_key)); + if (req.get_tx_keys) + res.tx_key_list.push_back(boost::lexical_cast(ptx.tx_key)); } return true; -- cgit v1.2.3