Skip to content

Commit

Permalink
update OutConnectionConfig::Tcp with default value (can set rate limit)
Browse files Browse the repository at this point in the history
  • Loading branch information
modship committed Apr 27, 2023
1 parent e02359b commit 2ad8dec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions massa-protocol-worker-2/src/connectivity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use massa_protocol_exports_2::{ProtocolConfig, ProtocolError};
use massa_storage::Storage;
use parking_lot::RwLock;
use peernet::peer_id::PeerId;
use peernet::transports::{OutConnectionConfig, TcpOutConnectionConfig, TransportType};
use peernet::transports::{OutConnectionConfig, TransportType};
use std::collections::HashMap;
use std::net::SocketAddr;
use std::{num::NonZeroUsize, sync::Arc};
Expand Down Expand Up @@ -206,7 +206,7 @@ pub(crate) fn start_connectivity_thread(
println!("Trying to connect to peer {:?}", addr);
}
// We only manage TCP for now
if let Err(err) = network_controller.try_connect(*addr, Duration::from_millis(200), &OutConnectionConfig::Tcp(Box::new(TcpOutConnectionConfig {}))) {
if let Err(err) = network_controller.try_connect(*addr, Duration::from_millis(200), &OutConnectionConfig::Tcp(Box::default())) {
warn!("Failed to connect to peer {:?}: {:?}", addr, err);
}
};
Expand Down
6 changes: 3 additions & 3 deletions massa-protocol-worker-2/src/handlers/peer_handler/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use peernet::{
network_manager::PeerNetManager,
peer::InitConnectionHandler,
peer_id::PeerId,
transports::{endpoint::Endpoint, OutConnectionConfig, TcpOutConnectionConfig, TransportType},
transports::{endpoint::Endpoint, OutConnectionConfig, TransportType},
types::KeyPair,
};
use std::cmp::Reverse;
Expand Down Expand Up @@ -227,7 +227,7 @@ impl Tester {
let _res = network_manager.try_connect(
*addr,
Duration::from_millis(500),
&OutConnectionConfig::Tcp(Box::new(TcpOutConnectionConfig {})),
&OutConnectionConfig::Tcp(Box::default()),
);
});
},
Expand Down Expand Up @@ -258,7 +258,7 @@ impl Tester {
let _res = network_manager.try_connect(
*listener.0,
Duration::from_millis(200),
&OutConnectionConfig::Tcp(Box::new(TcpOutConnectionConfig {})),
&OutConnectionConfig::Tcp(Box::default()),
);
});
}
Expand Down

0 comments on commit 2ad8dec

Please sign in to comment.