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

Commit

Permalink
send network messages on main protocol name (#7515)
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier authored Jul 19, 2023
1 parent c2f3daa commit 2933d34
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 2933d34

Please sign in to comment.