add amount to map key in show_ringmembers_hex

This commit is contained in:
moneroexamples 2018-08-30 14:22:05 +08:00
parent 33b544d8d7
commit a9a9360e11
1 changed files with 7 additions and 5 deletions

View File

@ -1684,16 +1684,13 @@ show_ringmembers_hex(string const& tx_hash_str)
vector<txin_to_key> input_key_imgs = xmreg::get_key_images(tx);
// key: vector of absolute_offsets,
// key: vector of absolute_offsets and associated amount (last value),
// value: vector of output_info_of_mixins
std::map<vector<uint64_t>, vector<string>> all_mixin_outputs;
// make timescale maps for mixins in input
for (txin_to_key const& in_key: input_key_imgs)
{
string const& key_image_str = pod_to_hex(in_key.k_image);
{
// get absolute offsets of mixins
std::vector<uint64_t> absolute_offsets
= cryptonote::relative_output_offsets_to_absolute(
@ -1723,6 +1720,11 @@ show_ringmembers_hex(string const& tx_hash_str)
continue;
}
// add accociated amount to these offsets so that we can differentiate
// between same offsets, but for different amounts
absolute_offsets.push_back(in_key.amount);
for (auto const& mo: mixin_outputs)
all_mixin_outputs[absolute_offsets].emplace_back(pod_to_hex(mo));