diff --git a/libp2p/identity/identify_push/identify_push.py b/libp2p/identity/identify_push/identify_push.py index 77a65187..cf39fd76 100644 --- a/libp2p/identity/identify_push/identify_push.py +++ b/libp2p/identity/identify_push/identify_push.py @@ -176,7 +176,9 @@ async def push_identify_to_peers( host: IHost, peer_ids: set[ID] | None = None, observed_multiaddr: Multiaddr | None = None, -) -> None: + counter: dict[str, int] | None = None, + lock: trio.Lock | None = None, +) -> int: # <-- return the max concurrency """ Push an identify message to multiple peers in parallel. @@ -191,3 +193,5 @@ async def push_identify_to_peers( async with trio.open_nursery() as nursery: for peer_id in peer_ids: nursery.start_soon(limited_push, peer_id) + + return counter["max"] if counter else 0 diff --git a/tests/core/identity/identify_push/test_identify_push.py b/tests/core/identity/identify_push/test_identify_push.py index b0ffb677..292d1948 100644 --- a/tests/core/identity/identify_push/test_identify_push.py +++ b/tests/core/identity/identify_push/test_identify_push.py @@ -10,6 +10,7 @@ import trio from libp2p import ( new_host, ) +from libp2p.abc import IHost from libp2p.crypto.secp256k1 import ( create_new_key_pair, )