mirror of
https://github.com/monero-project/monero.git
synced 2025-07-28 02:25:24 -04:00
cryptonote_core: warn when the block rate deviates from expectations
The warning threshold is set to allow a false positive every ten days on average.
This commit is contained in:
parent
842a5d8bbe
commit
1168e8d5d5
4 changed files with 64 additions and 7 deletions
|
@ -900,6 +900,15 @@ difficulty_type Blockchain::get_difficulty_for_next_block()
|
|||
return diff;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
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();
|
||||
while (blocks--)
|
||||
timestamps[blocks] = m_db->get_block_timestamp(height - blocks - 1);
|
||||
return timestamps;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
// This function removes blocks from the blockchain until it gets to the
|
||||
// position where the blockchain switch started and then re-adds the blocks
|
||||
// that had been removed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue