File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
libp2p/identity/identify_push
tests/core/identity/identify_push Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,9 @@ async def push_identify_to_peers(
176
176
host : IHost ,
177
177
peer_ids : set [ID ] | None = None ,
178
178
observed_multiaddr : Multiaddr | None = None ,
179
- ) -> None :
179
+ counter : dict [str , int ] | None = None ,
180
+ lock : trio .Lock | None = None ,
181
+ ) -> int : # <-- return the max concurrency
180
182
"""
181
183
Push an identify message to multiple peers in parallel.
182
184
@@ -191,3 +193,5 @@ async def push_identify_to_peers(
191
193
async with trio .open_nursery () as nursery :
192
194
for peer_id in peer_ids :
193
195
nursery .start_soon (limited_push , peer_id )
196
+
197
+ return counter ["max" ] if counter else 0
Original file line number Diff line number Diff line change 10
10
from libp2p import (
11
11
new_host ,
12
12
)
13
+ from libp2p .abc import IHost
13
14
from libp2p .crypto .secp256k1 import (
14
15
create_new_key_pair ,
15
16
)
You can’t perform that action at this time.
0 commit comments