mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 14:17:46 +00:00
blockchain: fix off by one getting blocks
This commit is contained in:
parent
5f7cddeb53
commit
269a2a01ef
1 changed files with 2 additions and 2 deletions
|
@ -1444,7 +1444,7 @@ bool Blockchain::get_blocks(uint64_t start_offset, size_t count, std::list<std::
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
LOG_PRINT_L3("Blockchain::" << __func__);
|
||||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
||||||
if(start_offset > m_db->height())
|
if(start_offset >= m_db->height())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!get_blocks(start_offset, count, blocks))
|
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__);
|
LOG_PRINT_L3("Blockchain::" << __func__);
|
||||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
||||||
if(start_offset > m_db->height())
|
if(start_offset >= m_db->height())
|
||||||
return false;
|
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++)
|
||||||
|
|
Loading…
Reference in a new issue