Reduce timeout and rustfmt
@@ -6,15 +6,11 @@ use crate::{
};
use signatory::{ed25519, PublicKeyed};
use signatory_dalek::Ed25519Signer;
-use std::{
- net::TcpStream,
- time::Duration,
-};
+use std::{net::TcpStream, time::Duration};
use subtle::ConstantTimeEq;
use tendermint::node;
pub use tendermint::secret_connection::{PublicKey, SecretConnection};
-
/// Open a TCP socket connection encrypted with SecretConnection
pub fn open_secret_connection(
host: &str,
@@ -28,8 +24,8 @@ pub fn open_secret_connection(
info!("KMS node ID: {}", &public_key);
let socket = TcpStream::connect(format!("{}:{}", host, port))?;
- socket.set_read_timeout(Some(Duration::from_secs(5)))?;
- socket.set_write_timeout(Some(Duration::from_secs(5)))?;
+ socket.set_read_timeout(Some(Duration::from_secs(2)))?;
+ socket.set_write_timeout(Some(Duration::from_secs(2)))?;
let connection = SecretConnection::new(socket, &public_key, &signer)?;
let actual_peer_id = connection.remote_pubkey().peer_id();
