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

Commit 2933d34

Browse files
authored
send network messages on main protocol name (#7515)
1 parent c2f3daa commit 2933d34

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

node/network/bridge/src/network.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ pub(crate) fn send_message<M>(
6868
// list. The message payload can be quite large. If the underlying
6969
// network used `Bytes` this would not be necessary.
7070
let last_peer = peers.pop();
71-
// optimization: generate the protocol name once.
72-
let protocol_name = protocol_names.get_name(peer_set, version);
71+
72+
// We always send messages on the "main" name even when a negotiated
73+
// fallback is used. The libp2p implementation handles the fallback
74+
// under the hood.
75+
let protocol_name = protocol_names.get_main_name(peer_set);
7376
peers.into_iter().for_each(|peer| {
7477
net.write_notification(peer, protocol_name.clone(), message.clone());
7578
});

0 commit comments

Comments
 (0)