diff --git a/src/page.h b/src/page.h index 6151891..ae61c50 100644 --- a/src/page.h +++ b/src/page.h @@ -4039,6 +4039,14 @@ private: uint64_t inputs_xmr_sum {0}; + // ringct inputs can be mixture of known amounts (when old outputs) + // are spent, and unknown umounts (makrked in explorer by '?') when + // ringct outputs are spent. thus we totalling input amounts + // in such case, we need to show sum of known umounts, and + // indicate that this is minium sum, as we dont know the unknown + // umounts. + bool have_any_unknown_amount {false}; + vector> mixin_timestamp_groups; // make timescale maps for mixins in input @@ -4089,6 +4097,13 @@ private: inputs_xmr_sum += in_key.amount; + if (in_key.amount == 0) + { + // if any input has amount equal to zero, + // it is really an unkown amount + have_any_unknown_amount = true; + } + vector mixin_timestamps; // get reference to mixins array created above @@ -4199,13 +4214,18 @@ private: max_mix_timestamp ); + context["have_any_unknown_amount"] = have_any_unknown_amount; + context["inputs_xmr_sum_not_zero"] = (inputs_xmr_sum > 0); + context["inputs_xmr_sum"] = xmreg::xmr_amount_to_str(inputs_xmr_sum); + context["server_time"] = server_time_str; - context["inputs_xmr_sum"] = xmreg::xmr_amount_to_str(inputs_xmr_sum); - context["server_time"] = server_time_str; context.emplace("inputs", inputs); + context["min_mix_time"] = xmreg::timestamp_to_str(min_mix_timestamp); context["max_mix_time"] = xmreg::timestamp_to_str(max_mix_timestamp); + context.emplace("timescales", mixins_timescales.first); + context["timescales_scale"] = fmt::format("{:0.2f}", mixins_timescales.second / 3600.0 / 24.0); // in days diff --git a/src/templates/partials/tx_details.html b/src/templates/partials/tx_details.html index da73875..40362a7 100644 --- a/src/templates/partials/tx_details.html +++ b/src/templates/partials/tx_details.html @@ -137,8 +137,20 @@ -

{{inputs_no}} inputs(s) for total of {{inputs_xmr_sum}} xmr

-
+ {{^inputs_xmr_sum_not_zero}} +

{{inputs_no}} inputs(s) for total of {{inputs_xmr_sum}} xmr

+ {{/inputs_xmr_sum_not_zero}} + {{#inputs_xmr_sum_not_zero}} + {{^have_any_unknown_amount}} +

{{inputs_no}} inputs(s) for total of {{inputs_xmr_sum}} xmr

+ {{/have_any_unknown_amount}} + {{#have_any_unknown_amount}} +

{{inputs_no}} inputs(s) for total of at least {{inputs_xmr_sum}} xmr

+ {{/have_any_unknown_amount}} + {{/inputs_xmr_sum_not_zero}} + + +
{{#inputs}}