mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Correctly update range status when outdated chains are removed (#2827)
We were batch removing chains when purging, and then updating the status of the collection for each of those. This makes the range status be out of sync with the real status. This represented no harm to the global sync status, but I've changed it to comply with a correct debug assertion that I got triggered while doing some testing. Also added tests and improved code quality as per @paulhauner 's suggestions.
This commit is contained in:
@@ -62,10 +62,10 @@ impl<T: EthSpec> SyncNetworkContext<T> {
|
||||
|
||||
pub fn status_peers<C: ToStatusMessage>(
|
||||
&mut self,
|
||||
chain: C,
|
||||
chain: &C,
|
||||
peers: impl Iterator<Item = PeerId>,
|
||||
) {
|
||||
if let Ok(status_message) = &chain.status_message() {
|
||||
if let Ok(status_message) = chain.status_message() {
|
||||
for peer_id in peers {
|
||||
debug!(
|
||||
self.log,
|
||||
|
||||
Reference in New Issue
Block a user