remove debugging code

This commit is contained in:
John Smith 2022-09-14 14:45:44 -04:00
parent 8878817961
commit d160344a77
2 changed files with 11 additions and 16 deletions

View File

@ -185,11 +185,6 @@ impl ConnectionManager {
// Connection already exists // Connection already exists
let desc = conn.connection_descriptor(); let desc = conn.connection_descriptor();
let _ = inner.sender.send(ConnectionManagerEvent::Dead(conn)); let _ = inner.sender.send(ConnectionManagerEvent::Dead(conn));
// xxx remove this
panic!(
"connection already exists: {:?} connection_table: {:#?}",
desc, self.arc.connection_table
);
return Ok(NetworkResult::no_connection_other(format!( return Ok(NetworkResult::no_connection_other(format!(
"connection already exists: {:?}", "connection already exists: {:?}",
desc desc

View File

@ -1314,14 +1314,14 @@ impl NetworkManager {
) -> SendPinBoxFuture<EyreResult<NetworkResult<SendDataKind>>> { ) -> SendPinBoxFuture<EyreResult<NetworkResult<SendDataKind>>> {
let this = self.clone(); let this = self.clone();
Box::pin(async move { Box::pin(async move {
info!("{}", format!("send_data to: {:?}", node_ref).red()); // info!("{}", format!("send_data to: {:?}", node_ref).red());
// First try to send data to the last socket we've seen this peer on // First try to send data to the last socket we've seen this peer on
let data = if let Some(connection_descriptor) = node_ref.last_connection() { let data = if let Some(connection_descriptor) = node_ref.last_connection() {
info!( // info!(
"{}", // "{}",
format!("last_connection to: {:?}", connection_descriptor).red() // format!("last_connection to: {:?}", connection_descriptor).red()
); // );
match this match this
.net() .net()
@ -1329,11 +1329,11 @@ impl NetworkManager {
.await? .await?
{ {
None => { None => {
info!( // info!(
"{}", // "{}",
format!("sent to existing connection: {:?}", connection_descriptor) // format!("sent to existing connection: {:?}", connection_descriptor)
.red() // .red()
); // );
// Update timestamp for this last connection since we just sent to it // Update timestamp for this last connection since we just sent to it
node_ref.set_last_connection(connection_descriptor, intf::get_timestamp()); node_ref.set_last_connection(connection_descriptor, intf::get_timestamp());
@ -1348,7 +1348,7 @@ impl NetworkManager {
data data
}; };
info!("{}", "no existing connection".red()); // info!("{}", "no existing connection".red());
// If we don't have last_connection, try to reach out to the peer via its dial info // If we don't have last_connection, try to reach out to the peer via its dial info
let contact_method = this.get_contact_method(node_ref.clone()); let contact_method = this.get_contact_method(node_ref.clone());