fix: no_of_last_blocks if greater than blockchain height

https://github.com/moneroexamples/onion-monero-blockchain-explorer/
issues/141
master
moneroexamples 6 years ago
parent 3125d4ae0a
commit 5fea46c28a

@ -582,12 +582,12 @@ index2(uint64_t page_no = 0, bool refresh_page = false)
uint64_t local_copy_server_timestamp = server_timestamp; 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 // get the current blockchain height. Just to check
uint64_t height = core_storage->get_current_blockchain_height(); 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 // initalise page tempate map with basic info about blockchain
mstch::map context { mstch::map context {
{"testnet" , testnet}, {"testnet" , testnet},

Loading…
Cancel
Save