is_ringct flag added to index page

master
moneroexamples 8 years ago
parent ffc41dfd86
commit 937c31f587

@ -583,6 +583,7 @@ public:
txd_map.insert({"blk_hash" , blk_hash_str}); txd_map.insert({"blk_hash" , blk_hash_str});
txd_map.insert({"time_delta", time_delta_str}); txd_map.insert({"time_delta", time_delta_str});
txd_map.insert({"age" , age.first}); txd_map.insert({"age" , age.first});
txd_map.insert({"is_ringct" , (tx.version > 1)});
// do not show block info for other than // do not show block info for other than
// last (i.e., first after reverse below) // last (i.e., first after reverse below)
@ -702,6 +703,26 @@ public:
if (!mixin_numbers.empty()) if (!mixin_numbers.empty())
mixin_no = mixin_numbers.at(0) - 1; mixin_no = mixin_numbers.at(0) - 1;
json j_tx;
string is_ringct_str {"N/A"};
try
{
j_tx = json::parse(_tx_info.tx_json);
if (j_tx["version"].get<size_t>() > 1)
{
is_ringct_str = "yes";
}
else
{
is_ringct_str = "no";
}
}
catch (std::invalid_argument& e)
{
cerr << " j_tx = json::parse(_tx_info.tx_json);: " << e.what() << endl;
}
// set output page template map // set output page template map
txs.push_back(mstch::map { txs.push_back(mstch::map {
{"timestamp" , xmreg::timestamp_to_str(_tx_info.receive_time)}, {"timestamp" , xmreg::timestamp_to_str(_tx_info.receive_time)},
@ -712,6 +733,7 @@ public:
{"xmr_outputs" , xmreg::xmr_amount_to_str(sum_outputs.first, "{:0.2f}")}, {"xmr_outputs" , xmreg::xmr_amount_to_str(sum_outputs.first, "{:0.2f}")},
{"no_inputs" , sum_inputs.second}, {"no_inputs" , sum_inputs.second},
{"no_outputs" , sum_outputs.second}, {"no_outputs" , sum_outputs.second},
{"is_ringct" , is_ringct_str},
{"mixin" , fmt::format("{:d}", mixin_no)}, {"mixin" , fmt::format("{:d}", mixin_no)},
{"txsize" , fmt::format("{:0.2f}", static_cast<double>(_tx_info.blob_size)/1024.0)} {"txsize" , fmt::format("{:0.2f}", static_cast<double>(_tx_info.blob_size)/1024.0)}
}); });
@ -3837,6 +3859,7 @@ private:
{"with_ring_signatures" , static_cast<bool>( {"with_ring_signatures" , static_cast<bool>(
with_ring_signatures)}, with_ring_signatures)},
{"tx_json" , tx_json}, {"tx_json" , tx_json},
{"is_ringct" , (tx.version > 1)},
{"has_error" , false}, {"has_error" , false},
{"error_msg" , string("")}, {"error_msg" , string("")},
{"have_raw_tx" , false}, {"have_raw_tx" , false},

@ -39,6 +39,7 @@
<td>fees</td> <td>fees</td>
<td>outputs</td> <td>outputs</td>
<td>in/out</td> <td>in/out</td>
<td>ringct?</td>
<td>mixin</td> <td>mixin</td>
<td>size [kB]</td> <td>size [kB]</td>
</tr> </tr>
@ -50,6 +51,10 @@
<td>{{tx_fee_short}}</td> <td>{{tx_fee_short}}</td>
<td>{{sum_outputs_short}}</td> <td>{{sum_outputs_short}}</td>
<td>{{no_inputs}}/{{no_outputs}}</td> <td>{{no_inputs}}/{{no_outputs}}</td>
<td>
{{#is_ringct}}yes{{/is_ringct}}
{{^is_ringct}}no{{/is_ringct}}
</td>
<td>{{mixin}}</td> <td>{{mixin}}</td>
<td>{{tx_size_short}}</td> <td>{{tx_size_short}}</td>
</tr> </tr>

@ -11,6 +11,7 @@
<td>fee</td> <td>fee</td>
<td>outputs</td> <td>outputs</td>
<td>in/out</td> <td>in/out</td>
<td>ringct?</td>
<td>mixin</td> <td>mixin</td>
<td>size [kB]</td> <td>size [kB]</td>
</tr> </tr>
@ -22,6 +23,7 @@
<td>{{fee}}</td> <td>{{fee}}</td>
<td>{{xmr_outputs}}</td> <td>{{xmr_outputs}}</td>
<td>{{no_inputs}}/{{no_outputs}}</td> <td>{{no_inputs}}/{{no_outputs}}</td>
<td>{{is_ringct}}</td>
<td>{{mixin}}</td> <td>{{mixin}}</td>
<td>{{txsize}}</td> <td>{{txsize}}</td>
</tr> </tr>

Loading…
Cancel
Save