From a474d66c980a9a8f7938340cc2d26ad063494248 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 24 Aug 2015 18:36:39 +0100 Subject: [PATCH] blockchain: fix offset/height comparisons in get_blocks --- src/cryptonote_core/blockchain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 2c65f70ff..d992176a8 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1316,7 +1316,7 @@ bool Blockchain::get_blocks(uint64_t start_offset, size_t count, std::list m_db->height()) + if(start_offset >= m_db->height()) return false; if (!get_blocks(start_offset, count, blocks)) @@ -1338,10 +1338,10 @@ bool Blockchain::get_blocks(uint64_t start_offset, size_t count, std::list 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++) + for(size_t i = start_offset; i < start_offset + count && i < m_db->height();i++) { blocks.push_back(m_db->get_block_from_height(i)); }