From e710234fcb041ab3b0cd70af90da855b931bfd5e Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 7 Sep 2016 08:01:07 +0800 Subject: [PATCH] timestamp added to blocks --- src/page.h | 38 ++++++++++++++++++++------------------ src/templates/block.html | 2 +- src/tools.cpp | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/page.h b/src/page.h index 0329d01..909cc60 100644 --- a/src/page.h +++ b/src/page.h @@ -755,25 +755,27 @@ namespace xmreg { // initalise page tempate map with basic info about blockchain mstch::map context { - {"blk_hash" , blk_hash_str}, - {"blk_height" , _blk_height}, - {"blk_timestamp" , blk_timestamp}, - {"prev_hash" , prev_hash_str}, - {"next_hash" , next_hash_str}, - {"have_next_hash" , have_next_hash}, - {"have_prev_hash" , have_prev_hash}, - {"have_txs" , have_txs}, - {"no_txs" , std::to_string(blk.tx_hashes.size())}, - {"blk_age" , age.first}, - {"delta_time" , delta_time}, - {"blk_nonce" , blk.nonce}, - {"age_format" , age.second}, - {"major_ver" , std::to_string(blk.major_version)}, - {"minor_ver" , std::to_string(blk.minor_version)}, - {"blk_size" , fmt::format("{:0.4f}", + {"blk_hash" , blk_hash_str}, + {"blk_height" , _blk_height}, + {"blk_timestamp" , blk_timestamp}, + {"blk_timestamp_epoch" , blk.timestamp}, + {"prev_hash" , prev_hash_str}, + {"next_hash" , next_hash_str}, + {"have_next_hash" , have_next_hash}, + {"have_prev_hash" , have_prev_hash}, + {"have_txs" , have_txs}, + {"no_txs" , std::to_string( + blk.tx_hashes.size())}, + {"blk_age" , age.first}, + {"delta_time" , delta_time}, + {"blk_nonce" , blk.nonce}, + {"age_format" , age.second}, + {"major_ver" , std::to_string(blk.major_version)}, + {"minor_ver" , std::to_string(blk.minor_version)}, + {"blk_size" , fmt::format("{:0.4f}", static_cast(blk_size) / 1024.0)}, - {"coinbase_txs" , mstch::array{{txd_coinbase.get_mstch_map()}}}, - {"blk_txs" , mstch::array()} + {"coinbase_txs" , mstch::array{{txd_coinbase.get_mstch_map()}}}, + {"blk_txs" , mstch::array()} }; // .push_back(txd_coinbase.get_mstch_map() diff --git a/src/templates/block.html b/src/templates/block.html index ae3bf1b..117a4f9 100644 --- a/src/templates/block.html +++ b/src/templates/block.html @@ -16,7 +16,7 @@ - + diff --git a/src/tools.cpp b/src/tools.cpp index bd26c7f..d42caf7 100644 --- a/src/tools.cpp +++ b/src/tools.cpp @@ -611,7 +611,7 @@ namespace xmreg uint64_t timestamp_place = double(timestamp-time0) / double(interval_length)*(time_axis_length-1); - //cout << timestamp_place << endl; + empty_time[timestamp_place + 1] = '*'; }
Timestamp [UCT]:{{blk_timestamp}}Timestamp [UCT] (epoch):{{blk_timestamp}} ({{blk_timestamp_epoch}}) Age {{age_format}}:{{blk_age}} Δ [h:m:s]:{{delta_time}}