From abb317dd40afb0bb8cc013a81eed4dba583acd24 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 1 May 2016 12:17:19 +0800 Subject: [PATCH] order of tx in the index2 fixed --- src/page.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/page.h b/src/page.h index aea0c32..3587d3f 100644 --- a/src/page.h +++ b/src/page.h @@ -502,8 +502,11 @@ namespace xmreg { uint64_t tx_i {0}; - for (const cryptonote::transaction& tx : blk_txs) - { + for(list::reverse_iterator rit = blk_txs.rbegin(); + rit != blk_txs.rend(); ++rit) + { + const cryptonote::transaction& tx = *rit; + tx_details txd = get_tx_details(tx); mstch::map txd_map = txd.get_mstch_map(); @@ -515,8 +518,9 @@ namespace xmreg { txd_map.insert({"age" , age.first}); // do not show block info for other than - // first tx in the block - if (tx_i > 0) + // last (i.e., first after reverse below) + // tx in the block + if (tx_i < blk_txs.size() - 1) { txd_map["height"] = string(""); txd_map["age"] = string("");