Timing fixes and mining protection.

Pools should use the new code for their mining daemons.