Whether you knew about the patent only affects how much the patent owner can demand in damages -- they can in any case stop you from shipping your product and demand a chunk of all your past revenue.
Everyone who writes some software is violating other people's patents; the problem is if one of those patent owners notices and can sue you.