0.8.8update

This commit is contained in:
mydesktop 2014-05-25 13:06:40 -04:00
parent b77470a5c0
commit 3a3a817678
43 changed files with 504 additions and 408 deletions

View file

@ -29,10 +29,11 @@ namespace cryptonote
return !m_points.empty() && (height <= (--m_points.end())->first);
}
//---------------------------------------------------------------------------
bool checkpoints::check_block(uint64_t height, const crypto::hash& h) const
bool checkpoints::check_block(uint64_t height, const crypto::hash& h, bool& is_a_checkpoint) const
{
auto it = m_points.find(height);
if(it == m_points.end())
is_a_checkpoint = it != m_points.end();
if(!is_a_checkpoint)
return true;
if(it->second == h)
@ -45,4 +46,25 @@ namespace cryptonote
return false;
}
}
//---------------------------------------------------------------------------
bool checkpoints::check_block(uint64_t height, const crypto::hash& h) const
{
bool ignored;
return check_block(height, h, ignored);
}
//---------------------------------------------------------------------------
bool checkpoints::is_alternative_block_allowed(uint64_t blockchain_height, uint64_t block_height) const
{
if (0 == block_height)
return false;
auto it = m_points.upper_bound(blockchain_height);
// Is blockchain_height before the first checkpoint?
if (it == m_points.begin())
return true;
--it;
uint64_t checkpoint_height = it->first;
return checkpoint_height < block_height;
}
}