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
vector<pair<txout_to_key, uint64_t>> 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<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};
@ -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)
{

View File

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