From 34e9aa72d7fc05f68eca1832cd376b99bdd77ed9 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Thu, 6 Oct 2016 12:53:33 +0800 Subject: [PATCH] amounts of inputs shown for signed raw tx --- src/page.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/page.h b/src/page.h index 891867d..ab08551 100644 --- a/src/page.h +++ b/src/page.h @@ -1479,6 +1479,7 @@ namespace xmreg { vector real_output_pub_keys; vector real_output_indices; + vector real_amounts; for (const tx_source_entry& tx_source: ptx.construction_data.sources) { @@ -1505,6 +1506,7 @@ namespace xmreg { ); real_output_indices.push_back(tx_source.real_output); + real_amounts.push_back(tx_source.amount); } mstch::map tx_context = construct_tx_context(ptx.tx); @@ -1512,9 +1514,19 @@ namespace xmreg { // get reference to inputs array created of the tx mstch::array& inputs = boost::get(tx_context["inputs"]); + uint64_t input_idx {0}; + // mark which mixin is real in each input's mstch context for (mstch::node& input_node: inputs) { + + // show input amount + string& amount = boost::get( + boost::get(input_node)["amount"] + ); + + amount = fmt::format("{:0.12f}", XMR_AMOUNT(real_amounts.at(input_idx))); + mstch::array& mixins = boost::get( boost::get(input_node)["mixins"] ); @@ -1535,13 +1547,14 @@ namespace xmreg { mixin["mix_is_it_real"] = true; } } + + ++input_idx; } // mark real mixing in the mixins timescale graph mstch::array& mixins_timescales = boost::get(tx_context["timescales"]); - uint64_t idx {0}; for (mstch::node& timescale_node: mixins_timescales)