From 26ec15c6f788df3adb6ff3b912a0c4b5d3139358 Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 4 Oct 2024 13:47:25 +0200 Subject: [PATCH] Removes inflight semaphore --- codex/blockexchange/network/network.nim | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/codex/blockexchange/network/network.nim b/codex/blockexchange/network/network.nim index b6195473..34b09202 100644 --- a/codex/blockexchange/network/network.nim +++ b/codex/blockexchange/network/network.nim @@ -75,7 +75,6 @@ type handlers*: BlockExcHandlers request*: BlockExcRequest getConn: ConnProvider - inflightSema: AsyncSemaphore proc peerId*(b: BlockExcNetwork): PeerId = ## Return peer id @@ -99,14 +98,11 @@ proc send*(b: BlockExcNetwork, id: PeerId, msg: pb.Message) {.async.} = let peer = b.peers[id] try: - await b.inflightSema.acquire() await peer.send(msg) except CancelledError as error: raise error except CatchableError as err: error "Error sending message", peer = id, msg = err.msg - finally: - b.inflightSema.release() proc handleWantList( b: BlockExcNetwork, @@ -332,8 +328,7 @@ proc new*( let self = BlockExcNetwork( switch: switch, - getConn: connProvider, - inflightSema: newAsyncSemaphore(maxInflight)) + getConn: connProvider) proc sendWantList( id: PeerId,