diff --git a/quicp2p.nim b/quicp2p.nim index 051fe2d..315f751 100644 --- a/quicp2p.nim +++ b/quicp2p.nim @@ -172,7 +172,9 @@ proc initContext(sock: AsyncSocket, certChainPath: string, keyPath: string, result.tlsCtx.signCertificate = addr result.signCertificate.super proc sendPackets(ctx: QuicP2PContext) = - let conns = ctx.connections + if ctx.connections.len == 0: + return + let conns = ctx.connections.deepCopy() for i in 0 .. conns.len - 1: var srcAddr, dstAddr: quicly_address_t var dgrams: array[10, IOVec]