total xmr spend added to Signed Key Images Checker

This commit is contained in:
moneroexamples 2016-10-26 09:58:51 +08:00
parent 14f85fa45c
commit 314d679812
2 changed files with 14 additions and 0 deletions

View File

@ -2033,6 +2033,8 @@ namespace xmreg {
mstch::map context {
{"testnet" , testnet},
{"address" , xmreg::print_address(*xmr_address, testnet)},
{"has_total_xmr" , false},
{"total_xmr" , string{}},
{"key_imgs" , mstch::array{}}
};
@ -2054,6 +2056,8 @@ namespace xmreg {
mstch::array& key_imgs_ctx = boost::get<mstch::array>(context["key_imgs"]);
uint64_t total_xmr {0};
for (size_t n = 0; n < no_key_images; ++n)
{
@ -2119,6 +2123,7 @@ namespace xmreg {
if (it != tx_key_imgs.end())
{
key_img_info["amount"] = fmt::format("{:0.12f}", XMR_AMOUNT((*it).amount));
total_xmr += (*it).amount;
}
key_img_info["timestamp"] = xmreg::timestamp_to_str(blk_timestamp);
@ -2130,6 +2135,12 @@ namespace xmreg {
//signed_key_images.push_back(make_pair(key_image, signature));
}
if (total_xmr > 0)
{
context["has_total_xmr"] = true;
context["total_xmr"] = fmt::format("{:0.12f}", XMR_AMOUNT(total_xmr));
}
string checkrawkeyimgs_html = xmreg::read(TMPL_MY_CHECKRAWKEYIMGS);
// add footer

View File

@ -22,6 +22,9 @@
</div>
<h4>Key images for address: {{address}}</h4>
{{#has_total_xmr}}
<h4>Total value of xmr spend: {{total_xmr}}</h4>
{{/has_total_xmr}}
<div class="center">