global index added to outputs info

This commit is contained in:
moneroexamples 2016-05-09 23:44:37 +00:00
parent 22e8850a18
commit c7ad1b6127
2 changed files with 15 additions and 1 deletions

View file

@ -87,7 +87,6 @@ namespace xmreg {
// public keys and xmr amount of outputs // public keys and xmr amount of outputs
vector<pair<txout_to_key, uint64_t>> output_pub_keys; vector<pair<txout_to_key, uint64_t>> output_pub_keys;
mstch::map mstch::map
get_mstch_map() get_mstch_map()
{ {
@ -144,6 +143,7 @@ namespace xmreg {
return txd_map; return txd_map;
} }
string string
get_extra_str() get_extra_str()
{ {
@ -1071,6 +1071,10 @@ namespace xmreg {
context["timescales_scale"] = fmt::format("{:0.2f}", context["timescales_scale"] = fmt::format("{:0.2f}",
timescale_scale / 3600.0 / 24.0); // in days timescale_scale / 3600.0 / 24.0); // in days
vector<uint64_t> out_global_indices;
// get outputs global indices
core_storage->get_tx_outputs_gindexs(txd.hash, out_global_indices);
uint64_t output_idx {0}; uint64_t output_idx {0};
@ -1081,6 +1085,7 @@ namespace xmreg {
outputs.push_back(mstch::map { outputs.push_back(mstch::map {
{"out_pub_key" , REMOVE_HASH_BRAKETS(fmt::format("{:s}", outp.first.key))}, {"out_pub_key" , REMOVE_HASH_BRAKETS(fmt::format("{:s}", outp.first.key))},
{"amount" , fmt::format("{:0.12f}", XMR_AMOUNT(outp.second))}, {"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++)} {"output_idx" , fmt::format("{:02d}", output_idx++)}
}); });
} }
@ -1328,6 +1333,13 @@ namespace xmreg {
string result_html {default_txt}; 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 // first check if searching for block of given height
if (search_text.size() < 12) if (search_text.size() < 12)
{ {

View file

@ -46,11 +46,13 @@
<table class="center" > <table class="center" >
<tr> <tr>
<td>Outputs public keys</td> <td>Outputs public keys</td>
<td>Global index</td>
<td>amount</td> <td>amount</td>
</tr> </tr>
{{#outputs}} {{#outputs}}
<tr> <tr>
<td>{{output_idx}}: {{out_pub_key}}</td> <td>{{output_idx}}: {{out_pub_key}}</td>
<td>{{global_idx}}</td>
<td>{{amount}}</td> <td>{{amount}}</td>
</tr> </tr>
{{/outputs}} {{/outputs}}