Remove unnecessary propagation of gossips
@@ -2,7 +2,6 @@ use super::{Gossip, Gossips, P2pTopology, Peer};
use crate::intercom::{NetworkMsg, PropagateMsg, TopologyMsg};
use crate::settings::start::network::Configuration;
use crate::utils::async_msg::{MessageBox, MessageQueue};
-use futures::SinkExt;
use tokio::time::Interval;
use tokio_stream::StreamExt;
@@ -22,7 +21,7 @@ pub struct TaskData {
pub async fn start(task_data: TaskData) {
let TaskData {
- mut network_msgbox,
+ network_msgbox,
topology_queue,
initial_peers,
config,
@@ -30,18 +29,6 @@ pub async fn start(task_data: TaskData) {
let mut topology = P2pTopology::new(&config);
- // Send gossips for trusted peers at the beginning, without inserting them first in
- // the topology
- for peer in &initial_peers {
- let gossips = topology.initiate_gossips(&peer.id());
- network_msgbox
- .send(NetworkMsg::Propagate(PropagateMsg::Gossip(
- peer.clone(),
- gossips,
- )))
- .await
- .unwrap_or_else(|e| tracing::error!("Error sending gossips to network task: {}", e));
- }
topology.accept_gossips(Gossips::from(
initial_peers
.into_iter()
