From 88e233db81eefa00626755282ea93d3e94dbc58d Mon Sep 17 00:00:00 2001 From: diegomrsantos Date: Tue, 7 May 2024 15:44:14 +0200 Subject: [PATCH] fix: Asynchronous task [sendMsgSlow()] was cancelled [FutureDefect] (#1094) --- libp2p/protocols/pubsub/pubsubpeer.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/protocols/pubsub/pubsubpeer.nim b/libp2p/protocols/pubsub/pubsubpeer.nim index ce5bdc1af..d369a32db 100644 --- a/libp2p/protocols/pubsub/pubsubpeer.nim +++ b/libp2p/protocols/pubsub/pubsubpeer.nim @@ -304,7 +304,7 @@ proc sendMsgSlow(p: PubSubPeer, msg: seq[byte]) {.async.} = if p.sendConn == nil: # Wait for a send conn to be setup. `connectOnce` will # complete this even if the sendConn setup failed - await p.connectedFut + discard await race(p.connectedFut) var conn = p.sendConn if conn == nil or conn.closed():