mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
fix: dont throw exception when linking to next block at the top of blockchain
This commit is contained in:
parent
08e22f4870
commit
31fbb4423e
1 changed files with 6 additions and 1 deletions
|
@ -752,7 +752,12 @@ public:
|
||||||
crypto::hash blk_hash = core_storage->get_block_id_by_height(_blk_height);
|
crypto::hash blk_hash = core_storage->get_block_id_by_height(_blk_height);
|
||||||
|
|
||||||
crypto::hash prev_hash = blk.prev_id;
|
crypto::hash prev_hash = blk.prev_id;
|
||||||
crypto::hash next_hash = core_storage->get_block_id_by_height(_blk_height + 1);
|
crypto::hash next_hash = null_hash;
|
||||||
|
|
||||||
|
if (_blk_height + 1 <= current_blockchain_height)
|
||||||
|
{
|
||||||
|
next_hash = core_storage->get_block_id_by_height(_blk_height + 1);
|
||||||
|
}
|
||||||
|
|
||||||
bool have_next_hash = (next_hash == null_hash ? false : true);
|
bool have_next_hash = (next_hash == null_hash ? false : true);
|
||||||
bool have_prev_hash = (prev_hash == null_hash ? false : true);
|
bool have_prev_hash = (prev_hash == null_hash ? false : true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue