feat(snownet): timeout connections without a handshake after 20 seconds (#3633)

It was discovered by @conectado that this timeout needs to be longer
than 10 seconds.
This commit is contained in:
Thomas Eizinger
2024-02-15 12:55:46 +11:00
committed by GitHub
parent a2099599ad
commit c53553cd26
2 changed files with 2 additions and 2 deletions

View File

@@ -543,7 +543,7 @@ where
.initial
.iter()
.filter_map(|(id, conn)| {
(now.duration_since(conn.created_at) >= Duration::from_secs(10)).then_some(*id)
(now.duration_since(conn.created_at) >= Duration::from_secs(20)).then_some(*id)
})
.collect::<Vec<_>>();

View File

@@ -14,7 +14,7 @@ fn connection_times_out_after_10_seconds() {
ClientNode::<u64>::new(StaticSecret::random_from_rng(rand::thread_rng()), start);
let _ = alice.new_connection(1, HashSet::new(), HashSet::new());
alice.handle_timeout(start + Duration::from_secs(10));
alice.handle_timeout(start + Duration::from_secs(20));
assert_eq!(alice.poll_event().unwrap(), Event::ConnectionFailed(1));
}