Skip to content

Commit

Permalink
fix: only publish new tip on new stats
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Nov 25, 2024
1 parent b44b327 commit 52739b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sharechain/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,13 @@ impl ShareChain for InMemoryShareChain {
},
}
}
let _ = self.stat_client.send_chain_changed(
self.pow_algo,
p2_chain_write_lock.get_height(),
p2_chain_write_lock.get_max_chain_length() as u64,
);
if new_tip {
let _ = self.stat_client.send_chain_changed(
self.pow_algo,
p2_chain_write_lock.get_height(),
p2_chain_write_lock.get_max_chain_length() as u64,
);
}

if !missing_parents.is_empty() {
info!(target: LOG_TARGET, "[{:?}] Missing blocks for the following heights: {:?}", self.pow_algo, missing_parents.iter().map(|(hash,height)| format!("{}({:x}{:x}{:x}{:x})",height.to_string(), hash[0], hash[1], hash[2], hash[3])).collect::<Vec<String>>());
Expand Down

0 comments on commit 52739b1

Please sign in to comment.