File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
libp2p/identity/identify_push Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 41
41
PROTOCOL_VERSION = "ipfs/0.1.0"
42
42
AGENT_VERSION = get_agent_version ()
43
43
CONCURRENCY_LIMIT = 10
44
- LIMIT = trio .Semaphore (CONCURRENCY_LIMIT )
45
44
46
45
47
46
def identify_push_handler_for (host : IHost ) -> StreamHandlerFn :
@@ -134,7 +133,10 @@ async def _update_peerstore_from_identify(
134
133
135
134
136
135
async def push_identify_to_peer (
137
- host : IHost , peer_id : ID , observed_multiaddr : Multiaddr | None = None
136
+ host : IHost ,
137
+ peer_id : ID ,
138
+ observed_multiaddr : Multiaddr | None = None ,
139
+ limit = trio .Semaphore (CONCURRENCY_LIMIT ),
138
140
) -> bool :
139
141
"""
140
142
Push an identify message to a specific peer.
@@ -148,7 +150,7 @@ async def push_identify_to_peer(
148
150
True if the push was successful, False otherwise.
149
151
150
152
"""
151
- async with LIMIT :
153
+ async with limit :
152
154
try :
153
155
# Create a new stream to the peer using the identify/push protocol
154
156
stream = await host .new_stream (peer_id , [ID_PUSH ])
You can’t perform that action at this time.
0 commit comments