diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-10-06 22:56:17 +0400 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-10-06 22:56:17 +0400 |
commit | 4a20a5b5ea4adc47e65d9148e39dadf666e48e07 (patch) | |
tree | b48d6e5e7e86a396f36f46638e2bb02dd6b9ff2e /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #2534 (diff) | |
parent | blockchain: fix off by one getting blocks (diff) | |
download | monero-4a20a5b5ea4adc47e65d9148e39dadf666e48e07.tar.xz |
Merge pull request #2537
269a2a01 blockchain: fix off by one getting blocks (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 46427d161..3e0ffc409 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++) |