rct amount key modified as per luigi1111's recommendations

This allows the key to be not the same for two outputs sent to
the same address (eg, if you pay yourself, and also get change
back). Also remove the key amounts lists and return parameters
since we don't actually generate random ones, so we don't need
to save them as we can recalculate them when needed if we have
the correct keys.
This commit is contained in:
moneromooo-monero 2016-08-10 12:48:20 +01:00
parent 93f5c625f0
commit d4b62a1e29
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
15 changed files with 85 additions and 133 deletions

View file

@ -256,13 +256,6 @@ namespace tools
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;
}
@ -325,14 +318,6 @@ namespace tools
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));
}
}
}
}
@ -381,14 +366,6 @@ namespace tools
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));
}
}
}
}
@ -450,14 +427,6 @@ namespace tools
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));
}
}
}
}