mirror of
https://git.wownero.com/wownero/wownero.git
synced 2025-01-08 19:28:53 +00:00
blockchain: fix block rate check for empty blockchains
This commit is contained in:
parent
6f53b0f14e
commit
ccaffcfbb5
@ -901,8 +901,10 @@ difficulty_type Blockchain::get_difficulty_for_next_block()
|
||||
//------------------------------------------------------------------
|
||||
std::vector<time_t> Blockchain::get_last_block_timestamps(unsigned int blocks) const
|
||||
{
|
||||
std::vector<time_t> timestamps(blocks);
|
||||
uint64_t height = m_db->height();
|
||||
if (blocks > height)
|
||||
blocks = height;
|
||||
std::vector<time_t> timestamps(blocks);
|
||||
while (blocks--)
|
||||
timestamps[blocks] = m_db->get_block_timestamp(height - blocks - 1);
|
||||
return timestamps;
|
||||
|
Loading…
Reference in New Issue
Block a user