Lock code needed to erase Iphone data

It is not necessary to be in possession of the lock code to erase the iPhone, since a DFU restore can be performed at any time (until iOS 12 restricts USB access after 1 hour since last unlock).

Activation Lock will remain if the device is still in your iCloud account's Find My iPhone, but it seems you've already removed it otherwise you could use the Erase iPhone feature remotely.