Copy reset method from cgminer