Merged some fixes and patches from upstream eloipool sha-256 version