From c7ad1b6127a809784820559aa68e4865b4ab3785 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 9 May 2016 23:44:37 +0000 Subject: [PATCH] global index added to outputs info --- src/page.h | 14 +++++++++++++- src/templates/tx.html | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/page.h b/src/page.h index 33a251c..dce06fc 100644 --- a/src/page.h +++ b/src/page.h @@ -87,7 +87,6 @@ namespace xmreg { // public keys and xmr amount of outputs vector> output_pub_keys; - mstch::map get_mstch_map() { @@ -144,6 +143,7 @@ namespace xmreg { return txd_map; } + string get_extra_str() { @@ -1071,6 +1071,10 @@ 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); uint64_t output_idx {0}; @@ -1081,6 +1085,7 @@ namespace xmreg { 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))}, {"output_idx" , fmt::format("{:02d}", output_idx++)} }); } @@ -1328,6 +1333,13 @@ namespace xmreg { string result_html {default_txt}; + //cout << "XMR_AMOUNT(7000000000): " << XMR_AMOUNT(7000000000) << endl; + + //output_data_t output = core_storage->get_db().get_output_key(7000000000, 200689); + + //search_text = pod_to_hex(output.pubkey); + + // first check if searching for block of given height if (search_text.size() < 12) { diff --git a/src/templates/tx.html b/src/templates/tx.html index 0c22240..c278678 100644 --- a/src/templates/tx.html +++ b/src/templates/tx.html @@ -46,11 +46,13 @@ + {{#outputs}} + {{/outputs}}
Outputs public keysGlobal index amount
{{output_idx}}: {{out_pub_key}}{{global_idx}} {{amount}}