Skip to content
Open
Changes from all commits
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
35 changes: 12 additions & 23 deletions packetcrypt-annmine/src/annmine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,29 +345,18 @@ fn submit_to_pool(p: &Pool, ann_struct: &AnnResult, now: u64) {
Arc::clone(&pm.handlers[(ann_struct.dedup_hash as u64 % hcount) as usize])
};
let mut tip = handler.tip.lock().unwrap();
match tip.parent_block_height.cmp(&parent_block_height) {
std::cmp::Ordering::Greater => {
debug!(
"Miner produced an old announcement, want parent_block_height {} got {}",
tip.parent_block_height, parent_block_height
);
return;
}
std::cmp::Ordering::Less => {
// this prints for each handler
trace!(
"New block number {} -> {}",
tip.parent_block_height,
parent_block_height
);
submit_anns(
p,
&handler,
&mut *tip,
parent_block_height,
);
}
std::cmp::Ordering::Equal => (),
if tip.parent_block_height != parent_block_height {
trace!(
"New block number {} -> {}",
tip.parent_block_height,
parent_block_height
);
submit_anns(
p,
&handler,
&mut *tip,
parent_block_height,
);
}

tip.anns.push(ann_struct.ann.clone());
Expand Down