From 6e90720b996a305722f9ee524ce33fc6d19419e4 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Tue, 10 May 2016 00:22:13 +0000 Subject: [PATCH] amount of outputs of given amount added --- src/page.h | 15 ++++++++++----- src/templates/tx.html | 8 +++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/page.h b/src/page.h index dce06fc..984130c 100644 --- a/src/page.h +++ b/src/page.h @@ -1071,10 +1071,9 @@ namespace xmreg { context["timescales_scale"] = fmt::format("{:0.2f}", timescale_scale / 3600.0 / 24.0); // in days - vector out_global_indices; - - // get outputs global indices - core_storage->get_tx_outputs_gindexs(txd.hash, out_global_indices); + // get outputs global indices + vector out_global_indices = + core_storage->get_db().get_tx_amount_output_indices(txd.hash); uint64_t output_idx {0}; @@ -1082,10 +1081,16 @@ namespace xmreg { for (pair& outp: txd.output_pub_keys) { + + // total number of ouputs in the blockchain for this amount + uint64_t num_outputs_amount = core_storage->get_db() + .get_num_outputs(outp.second); + outputs.push_back(mstch::map { {"out_pub_key" , REMOVE_HASH_BRAKETS(fmt::format("{:s}", outp.first.key))}, {"amount" , fmt::format("{:0.12f}", XMR_AMOUNT(outp.second))}, - {"global_idx" , fmt::format("{:02d}", out_global_indices.at(output_idx))}, + {"global_idx" , fmt::format("{:d}", out_global_indices.at(output_idx))}, + {"num_outputs" , fmt::format("{:d}", num_outputs_amount)}, {"output_idx" , fmt::format("{:02d}", output_idx++)} }); } diff --git a/src/templates/tx.html b/src/templates/tx.html index c278678..3105068 100644 --- a/src/templates/tx.html +++ b/src/templates/tx.html @@ -43,17 +43,19 @@

Outputs ({{outputs_no}})

- +
- - + + + {{#outputs}} + {{/outputs}}
Outputs public keysGlobal indexoutputs public keysglobal index amounttotal # of outputs
for this amount
{{output_idx}}: {{out_pub_key}} {{global_idx}} {{amount}}{{num_outputs}}