Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: more logs to request sync logic #201

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/sharechain/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,16 +700,16 @@ impl ShareChain for InMemoryShareChain {
// Go back and find the split in the chain
for their_block in their_blocks {
if let Some(level) = p2_chain_read.level_at_height(their_block.0) {
if let Some(block) = level.blocks.get(&their_block.1) {
// Only split if the block is in the main chain
if level.chain_block == block.hash {
split_height2 = block.height.saturating_add(1);
break;
}
// Only split if the block is in the main chain
if level.chain_block == their_block.1 {
split_height2 = their_block.0.saturating_add(1);
break;
}
}
}

info!(target: LOG_TARGET, "[{:?}] Requesting sync, split_height1 {} splitheight2 {} last block {}", self.pow_algo, split_height, split_height2, last_block_received.as_ref().map(|(h, f)| h.to_string()).unwrap_or("None".to_string()));

let blocks =
self.all_blocks_with_lock(&p2_chain_read, Some(cmp::max(split_height, split_height2)), limit, true)?;
let tip_level = p2_chain_read
Expand Down
Loading