diff --git a/src/page.h b/src/page.h index b766230..c1ef8bf 100644 --- a/src/page.h +++ b/src/page.h @@ -578,7 +578,9 @@ namespace xmreg { string server_time_str = xmreg::timestamp_to_str(server_timestamp, "%F"); - mstch::array inputs; + + mstch::array inputs = mstch::array{}; + mstch::array mixins_timescales; // make timescale maps for mixins in input @@ -599,10 +601,16 @@ namespace xmreg { size_t count = 0; - inputs.push_back{mstch::map { + + inputs.push_back(mstch::map { {"in_key_img", fmt::format("{:s}", in_key.k_image)}, - {"in_amount", amount} - }; + {"amount" , fmt::format("{:0.3f}", XMR_AMOUNT(in_key.amount))}, + {"mixins" , mstch::array{}} + }); + + // get reference to mixins array created above + mstch::array& mixins = boost::get( + boost::get(inputs.back())["mixins"]); // for each found output public key find its block to get timestamp for (const uint64_t &i: absolute_offsets) @@ -618,6 +626,14 @@ namespace xmreg { return fmt::format("- cant get block of height: {}\n", output_data.height); } + pair mixin_age = get_age(server_timestamp, blk.timestamp); + + mixins.push_back(mstch::map { + {"mix_timestamp" , blk.timestamp}, + {"mix_age" , mixin_age.first}, + {"mix_age_format" , mixin_age.second} + }); + // get mixin timestamp from its orginal block mixin_timestamps.push_back(blk.timestamp); diff --git a/src/templates/tx.html b/src/templates/tx.html index e88eca4..fbc4856 100644 --- a/src/templates/tx.html +++ b/src/templates/tx.html @@ -35,19 +35,15 @@

Inputs {{inputs_no}}

- - - - + + - {{#coinbase_txs}} + {{#inputs}} - - - - + + - {{/coinbase_txs}} + {{/inputs}}
hashoutputssize [kB]versionkey imageamount
{{hash}}{{sum_outputs}}{{tx_size}}{{version}}{{in_key_img}}{{amount}}