mirror of
https://github.com/monero-project/monero.git
synced 2025-06-09 17:22:43 -04:00
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).
This commit is contained in:
parent
32077d3810
commit
d91eb8c7b4
6 changed files with 36 additions and 11 deletions
|
@ -218,7 +218,8 @@ namespace tools
|
|||
|
||||
// populate response with tx hash
|
||||
res.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(ptx_vector.back().tx));
|
||||
res.tx_key = boost::lexical_cast<std::string>(ptx_vector.back().tx_key);
|
||||
if (req.get_tx_key)
|
||||
res.tx_key = boost::lexical_cast<std::string>(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<std::string>(cryptonote::get_transaction_hash(ptx.tx)));
|
||||
res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
|
||||
if (req.get_tx_keys)
|
||||
res.tx_key_list.push_back(boost::lexical_cast<std::string>(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<std::string>(cryptonote::get_transaction_hash(ptx.tx)));
|
||||
res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
|
||||
if (req.get_tx_keys)
|
||||
res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue