Merge remote-tracking branch 'origin/main' into fix_multiselect_negotiate_type

This commit is contained in:
unniznd
2025-08-25 21:07:49 +05:30
51 changed files with 2927 additions and 86 deletions

View File

@ -17,6 +17,9 @@ from libp2p.custom_types import (
from libp2p.peer.id import (
ID,
)
from libp2p.protocol_muxer.exceptions import (
MultiselectError,
)
from libp2p.protocol_muxer.multiselect import (
Multiselect,
)
@ -84,8 +87,8 @@ class MuxerMultistream:
)
else:
protocol, _ = await self.multiselect.negotiate(communicator)
if protocol is None:
raise MuxerUpgradeFailure("No protocol selected")
if protocol is None:
raise MultiselectError("fail to negotiate a stream muxer protocol")
return self.transports[protocol]
async def new_conn(self, conn: ISecureConn, peer_id: ID) -> IMuxedConn: