Skip to content

Commit

Permalink
add log for node_ban_by_ids (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
Modship authored and Ben-PH committed Apr 17, 2023
1 parent 481a4f0 commit 6b8720c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions massa-network-worker/src/network_cmd_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ async fn node_ban_by_ids(worker: &mut NetworkWorker, ids: Vec<NodeId>) -> Result
.flat_map(|res| res.unwrap())
.collect::<HashSet<_>>();

if connection_ids_to_ban.is_empty() {
let log = format!(
"no connection to ban found when executing node_ban_by_ids for ids: {:?}",
ids
);
warn!("{}", &log);
return Err(NetworkError::GeneralProtocolError(log));
}

ban_connection_ids(worker, connection_ids_to_ban).await;
Ok(())
}
Expand Down

0 comments on commit 6b8720c

Please sign in to comment.