Minor typo.
Regenerate the hash before checking the share diff in hashtest().
Further consolidate the hash regeneration between sha and scrypt doing it only once and always checking the share diff for both before submission.