From afcfd27aa08033a276254a3266af96b21347fced Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Fri, 31 Jul 2020 14:02:03 +0900 Subject: [PATCH] add some verbosity to multistream handshake for debugging pruposes --- libp2p/multistream.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index 914e4ea3e..b82c51802 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -120,7 +120,7 @@ proc list*(m: MultistreamSelect, result = list proc handle*(m: MultistreamSelect, conn: Connection, active: bool = false) {.async, gcsafe.} = - trace "handle: starting multistream handling" + trace "handle: starting multistream handling", handshaked = active var handshaked = active try: while not conn.closed: @@ -154,7 +154,8 @@ proc handle*(m: MultistreamSelect, conn: Connection, active: bool = false) {.asy await conn.write(m.codec) handshaked = true else: - await conn.write(Na) + trace "handle: sending `na` for duplicate handshake while handshaked" + await conn.write(Na) else: for h in m.handlers: if (not isNil(h.match) and h.match(ms)) or ms == h.proto: