aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-27 00:31:06 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-27 00:31:49 +0100
commit269a2a01efb8edaf2b9921147320b103bec8f23a (patch)
tree054e60f91206634affc9b119f1e638a22f1f0ffa /src/cryptonote_core
parentMerge pull request #2533 (diff)
downloadmonero-269a2a01efb8edaf2b9921147320b103bec8f23a.tar.xz
blockchain: fix off by one getting blocks
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 0b09d503c..9b1bd6054 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -1444,7 +1444,7 @@ bool Blockchain::get_blocks(uint64_t start_offset, size_t count, std::list<std::
{
LOG_PRINT_L3("Blockchain::" << __func__);
CRITICAL_REGION_LOCAL(m_blockchain_lock);
- if(start_offset > m_db->height())
+ if(start_offset >= m_db->height())
return false;
if (!get_blocks(start_offset, count, blocks))
@@ -1466,7 +1466,7 @@ bool Blockchain::get_blocks(uint64_t start_offset, size_t count, std::list<std::
{
LOG_PRINT_L3("Blockchain::" << __func__);
CRITICAL_REGION_LOCAL(m_blockchain_lock);
- if(start_offset > m_db->height())
+ if(start_offset >= m_db->height())
return false;
for(size_t i = start_offset; i < start_offset + count && i < m_db->height();i++)