diff --git a/src/page.h b/src/page.h index 4d299ca..bc6d5e3 100644 --- a/src/page.h +++ b/src/page.h @@ -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(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 diff --git a/src/templates/checkrawkeyimgs.html b/src/templates/checkrawkeyimgs.html index 7f84df4..f73de6c 100644 --- a/src/templates/checkrawkeyimgs.html +++ b/src/templates/checkrawkeyimgs.html @@ -22,6 +22,9 @@

Key images for address: {{address}}

+ {{#has_total_xmr}} +

Total value of xmr spend: {{total_xmr}}

+ {{/has_total_xmr}}