From 5fea46c28a99f82fd3a23d651b46c21d09fa6c47 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 3 Sep 2018 07:41:46 +0800 Subject: [PATCH] fix: no_of_last_blocks if greater than blockchain height https://github.com/moneroexamples/onion-monero-blockchain-explorer/ issues/141 --- src/page.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/page.h b/src/page.h index 0d6a51a..0e9d7ee 100644 --- a/src/page.h +++ b/src/page.h @@ -582,12 +582,12 @@ index2(uint64_t page_no = 0, bool refresh_page = false) uint64_t local_copy_server_timestamp = server_timestamp; - // number of last blocks to show - uint64_t no_of_last_blocks {no_blocks_on_index + 1}; - // get the current blockchain height. Just to check uint64_t height = core_storage->get_current_blockchain_height(); + // number of last blocks to show + uint64_t no_of_last_blocks = std::min(no_blocks_on_index + 1, height); + // initalise page tempate map with basic info about blockchain mstch::map context { {"testnet" , testnet},