diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2018-06-16 14:05:53 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2018-06-16 14:05:53 -0500 |
| commit | fb2b16f10a92b4c2008d74cee339ceee9093fa0b (patch) | |
| tree | 452c3915e17eef444a9e8353c051daf4d1375183 | |
| parent | abfff766e5a5035d100475a747047864b48ff3be (diff) | |
| parent | fa0839f2f58ec84bbfe619aec25a6393277681c8 (diff) | |
| download | monzero-core-fb2b16f10a92b4c2008d74cee339ceee9093fa0b.tar.gz monzero-core-fb2b16f10a92b4c2008d74cee339ceee9093fa0b.tar.xz monzero-core-fb2b16f10a92b4c2008d74cee339ceee9093fa0b.zip | |
Merge pull request #3732
fa0839f Ensure m_timestamps has the correct number for computing difficulty. (thaerkh)
| -rw-r--r-- | src/cryptonote_core/blockchain.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index ae2b47570..38f7f94e1 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -827,7 +827,7 @@ difficulty_type Blockchain::get_difficulty_for_next_block() // then when the next block difficulty is queried, push the latest height data and // pop the oldest one from the list. This only requires 1x read per height instead // of doing 735 (DIFFICULTY_BLOCKS_COUNT). - if (m_timestamps_and_difficulties_height != 0 && ((height - m_timestamps_and_difficulties_height) == 1)) + if (m_timestamps_and_difficulties_height != 0 && ((height - m_timestamps_and_difficulties_height) == 1) && m_timestamps.size() >= DIFFICULTY_BLOCKS_COUNT) { uint64_t index = height - 1; m_timestamps.push_back(m_db->get_block_timestamp(index)); |
