diff --git a/crates/core/src/message.rs b/crates/core/src/message.rs index b20ff8727..fc20645c9 100644 --- a/crates/core/src/message.rs +++ b/crates/core/src/message.rs @@ -304,8 +304,6 @@ pub(crate) trait InnerMessage: Into { /// Internal node events emitted to the event loop. #[derive(Debug, Clone)] pub(crate) enum NodeEvent { - /// For unspecified reasons the node is gracefully shutting down. - ShutdownNode, /// Drop the given peer connection. DropConnection(PeerId), // Try connecting to the given peer. @@ -321,7 +319,6 @@ pub(crate) enum NodeEvent { impl Display for NodeEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - NodeEvent::ShutdownNode => f.write_str("ShutdownNode"), NodeEvent::DropConnection(peer) => { write!(f, "DropConnection (from {peer})") } diff --git a/crates/core/src/node/network_bridge/p2p_protoc.rs b/crates/core/src/node/network_bridge/p2p_protoc.rs index e9d183165..cfb571ead 100644 --- a/crates/core/src/node/network_bridge/p2p_protoc.rs +++ b/crates/core/src/node/network_bridge/p2p_protoc.rs @@ -473,10 +473,6 @@ impl P2pConnManager { } } } - Ok(Right(NodeAction(NodeEvent::ShutdownNode))) => { - tracing::info!("Shutting down message loop gracefully"); - break; - } Ok(Right(NodeAction(NodeEvent::ConnectPeer { peer, callback }))) => { tracing::info!(remote = %peer, this_peer = ?op_manager.ring.get_peer_key().unwrap(), "Connecting to peer"); let mut ob = outbound_conn_handler.clone(); diff --git a/crates/core/src/node/testing_impl.rs b/crates/core/src/node/testing_impl.rs index 433bd9b5f..dd92b92a9 100644 --- a/crates/core/src/node/testing_impl.rs +++ b/crates/core/src/node/testing_impl.rs @@ -1077,7 +1077,6 @@ where let msg = match msg { Ok(Either::Left(msg)) => msg, Ok(Either::Right(action)) => match action { - NodeEvent::ShutdownNode => break Ok(()), NodeEvent::DropConnection(peer) => { tracing::info!("Dropping connection to {peer}"); event_register diff --git a/crates/core/src/transport/crypto.rs b/crates/core/src/transport/crypto.rs index 368841a79..a6677404b 100644 --- a/crates/core/src/transport/crypto.rs +++ b/crates/core/src/transport/crypto.rs @@ -1,4 +1,4 @@ -use pkcs1::EncodeRsaPrivateKey; +use pkcs1::{EncodeRsaPrivateKey, EncodeRsaPublicKey}; use rand::rngs::OsRng; use rsa::{Pkcs1v15Encrypt, RsaPrivateKey, RsaPublicKey}; use serde::{Deserialize, Serialize};