diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index 2613fdc96..fcb0e88cc 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -46,39 +46,39 @@ proc newMultistream*(): MultisteamSelect = proc select*(m: MultisteamSelect, conn: Connection, - proto: seq[string]): + proto: seq[string]): Future[string] {.async.} = - debug "select: initiating handshake", codec = m.codec + debug "initiating handshake", codec = m.codec ## select a remote protocol await conn.write(m.codec) # write handshake if proto.len() > 0: - debug "select: selecting proto", proto = proto + info "selecting proto", proto = proto await conn.writeLp((proto[0] & "\n")) # select proto result = cast[string](await conn.readLp()) # read ms header result.removeSuffix("\n") if result != Codec: - debug "select: handshake failed", codec = result + debug "handshake failed", codec = result return "" if proto.len() == 0: # no protocols, must be a handshake call return result = cast[string](await conn.readLp()) # read the first proto - debug "select: reading first requested proto" + info "reading first requested proto" result.removeSuffix("\n") if result == proto[0]: - debug "select: succesfully selected ", proto = proto + debug "succesfully selected ", proto = proto return if not result.len > 0: - debug "select: selecting one of several protos" + info "selecting one of several protos" for p in proto[1..