Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions crates/net/network/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,7 @@ async fn authenticate_stream(
(eth_stream.into(), their_status)
} else {
// Multiplex the stream with the extra protocols
let (mut multiplex_stream, their_status) = RlpxProtocolMultiplexer::new(p2p_stream)
.into_eth_satellite_stream(status, fork_filter)
.await
.unwrap();
let mut multiplex_stream = RlpxProtocolMultiplexer::new(p2p_stream);

// install additional handlers
for handler in extra_handlers.into_iter() {
Expand All @@ -1022,6 +1019,19 @@ async fn authenticate_stream(
.ok();
}

let (multiplex_stream, their_status) =
match multiplex_stream.into_eth_satellite_stream(status, fork_filter).await {
Ok((multiplex_stream, their_status)) => (multiplex_stream, their_status),
Err(err) => {
return PendingSessionEvent::Disconnected {
remote_addr,
session_id,
direction,
error: Some(PendingSessionHandshakeError::Eth(err)),
}
}
};

(multiplex_stream.into(), their_status)
};

Expand Down