From d686a1809e225abbb84f6fb8ecd8254c536798dc Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 26 Oct 2016 18:53:35 +0800 Subject: [PATCH] show total amounts of outputs for signed tx data file --- src/page.h | 5 +++++ src/templates/checkrawtx.html | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/page.h b/src/page.h index 7c60255..4f36130 100644 --- a/src/page.h +++ b/src/page.h @@ -1607,6 +1607,7 @@ namespace xmreg { mstch::array destination_addresses; vector real_ammounts; + uint64_t outputs_xmr_sum {0}; // destiantion address for this tx for (tx_destination_entry& a_dest: ptx.construction_data.splitted_dsts) @@ -1623,6 +1624,8 @@ namespace xmreg { } ); + outputs_xmr_sum += a_dest.amount; + real_ammounts.push_back(a_dest.amount); } @@ -1640,6 +1643,8 @@ namespace xmreg { real_ammounts.push_back(ptx.construction_data.change_dts.amount); }; + tx_context["outputs_xmr_sum"] = fmt::format("{:0.12f}", XMR_AMOUNT(outputs_xmr_sum)); + tx_context.insert({"dest_infos", destination_addresses}); // get reference to inputs array created of the tx diff --git a/src/templates/checkrawtx.html b/src/templates/checkrawtx.html index 45b95db..4e987f4 100644 --- a/src/templates/checkrawtx.html +++ b/src/templates/checkrawtx.html @@ -82,8 +82,7 @@ {{/outputs}} {{/dest_sources}} -

Change to be returned to the sender

- Amount: {{change_amount}} +

Change to be returned to the sender: {{change_amount}}

{{/txs}} {{/unsigned_tx_given}}