Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

send network messages on main protocol name #7515

Merged
merged 1 commit into from
Jul 19, 2023
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
7 changes: 5 additions & 2 deletions node/network/bridge/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ pub(crate) fn send_message<M>(
// list. The message payload can be quite large. If the underlying
// network used `Bytes` this would not be necessary.
let last_peer = peers.pop();
// optimization: generate the protocol name once.
let protocol_name = protocol_names.get_name(peer_set, version);

// We always send messages on the "main" name even when a negotiated
// fallback is used. The libp2p implementation handles the fallback
// under the hood.
let protocol_name = protocol_names.get_main_name(peer_set);
peers.into_iter().for_each(|peer| {
net.write_notification(peer, protocol_name.clone(), message.clone());
});
Expand Down