Skip to content

Commit

Permalink
Fix checkpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
AxVultis committed Aug 18, 2024
1 parent e076ae9 commit 1bb9580
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/CryptoNoteCore/Blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,11 @@ namespace cn

m_config_folder = config_folder;

m_checkpoints.init_targets(testnet, appendPath(config_folder, m_currency.checkpointFileName()));
m_checkpoints.load_checkpoints_from_file();
if (load_existing)
{
m_checkpoints.init_targets(testnet, appendPath(config_folder, m_currency.checkpointFileName()));
m_checkpoints.load_checkpoints_from_file();
}

if (!m_blocks.open(appendPath(config_folder, m_currency.blocksFileName()), appendPath(config_folder, m_currency.blockIndexesFileName()), 1024))
{
Expand Down
2 changes: 0 additions & 2 deletions src/CryptoNoteCore/CheckpointList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ namespace cn {
{
lowest_height = 0;
}
std::cout << block_height << " " << lowest_height << " \n";
if (block_height < lowest_height && !is_in_checkpoint_zone(block_height))
{
logger(logging::DEBUGGING, logging::WHITE)
Expand All @@ -207,7 +206,6 @@ namespace cn {
}

uint32_t checkpoint_height = get_greatest_target_height();
std::cout << checkpoint_height << " " << block_height << " \n";
return checkpoint_height < block_height;
}

Expand Down
2 changes: 1 addition & 1 deletion src/CryptoNoteCore/CheckpointList.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace cn
bool is_in_checkpoint_zone(uint32_t height) const
{
const std::lock_guard<std::mutex> lock(m_points_lock);
return m_points.size() < height;
return m_points.size() > height;
}

enum check_rt
Expand Down

0 comments on commit 1bb9580

Please sign in to comment.