From 261d12d2c550092dcddd476583761599db63b8c1 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 1 May 2016 16:07:49 +0800 Subject: [PATCH] timestamp added to search_results --- src/page.h | 13 +++++++++++-- src/templates/partials/tx_table_header.html | 1 + src/templates/partials/tx_table_row.html | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/page.h b/src/page.h index dc8d8d5..a8a4188 100644 --- a/src/page.h +++ b/src/page.h @@ -73,7 +73,7 @@ namespace xmreg { uint64_t size; size_t version; uint64_t unlock_time; - vector extra; + vector extra; crypto::hash payment_id = null_hash; // normal crypto::hash8 payment_id8 = null_hash8; // encrypted @@ -1223,7 +1223,16 @@ namespace xmreg { tx_details txd = get_tx_details(tx); - boost::get((res.first)->second).push_back(txd.get_mstch_map()); + mstch::map txd_map = txd.get_mstch_map(); + + // get timestamp of the tx's block + uint64_t blk_height = core_storage->get_db().get_tx_block_height(txd.hash); + uint64_t blk_timestamp = core_storage->get_db().get_block_timestamp(blk_height); + + // add the timestamp to tx mstch map + txd_map.insert({"timestamp", xmreg::timestamp_to_str(blk_timestamp)}); + + boost::get((res.first)->second).push_back(txd_map); // dont show more than 500 results if (tx_i > 500) diff --git a/src/templates/partials/tx_table_header.html b/src/templates/partials/tx_table_header.html index 85f0e47..123d214 100644 --- a/src/templates/partials/tx_table_header.html +++ b/src/templates/partials/tx_table_header.html @@ -1,4 +1,5 @@ + timestamp tx hash outputs fee diff --git a/src/templates/partials/tx_table_row.html b/src/templates/partials/tx_table_row.html index e2c317f..ac26266 100644 --- a/src/templates/partials/tx_table_row.html +++ b/src/templates/partials/tx_table_row.html @@ -1,4 +1,5 @@ + {{timestamp}} {{hash}} {{sum_outputs}} {{tx_fee}}