diff options
| author | Riccardo Spagni <ric@spagni.net> | 2018-10-26 22:18:41 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2018-10-26 22:18:41 +0200 |
| commit | 557c17e206c697174982d28636a29c149f07f630 (patch) | |
| tree | 1c7766b3b639478d8582b3616568df0dd4e2fc25 /src/cryptonote_core/blockchain.cpp | |
| parent | 1c91963dcd95871b294f2c9411a90b0a8eaa6f20 (diff) | |
| parent | 341b3931ed79dd0b16a04e8a1468179ba5dd22c2 (diff) | |
| download | monzero-core-557c17e206c697174982d28636a29c149f07f630.tar.gz monzero-core-557c17e206c697174982d28636a29c149f07f630.tar.xz monzero-core-557c17e206c697174982d28636a29c149f07f630.zip | |
Merge pull request #4408
341b3931 cryptonote_core: warn when the block rate deviates from expectations (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
| -rw-r--r-- | src/cryptonote_core/blockchain.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 1ec2366e4..5c6819fa9 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -886,6 +886,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. |
