代码拉取完成,页面将自动刷新
#include "uint256.h"
#ifdef __cplusplus
extern "C"{
#endif
#include "miner.h"
// compute the diff ratio between a found hash and the target
double hash_target_ratio(uint32_t* hash, uint32_t* target)
{
uint256 h, t;
double dhash;
if (!opt_showdiff)
return 0.0;
memcpy(&t, (void*) target, 32);
memcpy(&h, (void*) hash, 32);
dhash = h.getdouble();
if (dhash > 0.)
return t.getdouble() / dhash;
else
return dhash;
}
// store ratio in work struct
void work_set_target_ratio( struct work* work, uint32_t* hash )
{
// only if the option is enabled (to reduce cpu usage)
if (opt_showdiff) {
work->shareratio = hash_target_ratio(hash, work->target);
work->sharediff = work->targetdiff * work->shareratio;
}
}
#ifdef __cplusplus
}
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。