Answer:
You can protect the code you have developed by addressing this in your reseller agreement, by outlining that you own the intellectual property in the software and that you are only licensing the intellectual property to the reseller, rather than assigning it (or giving it away). A contract lawyer can help you make sure your agreement is drafted in a way that will license rather than assign your intellectual property in the software.