From 48c937f1b9e554d43a7df4cd66336f66dce68b68 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 19 Oct 2017 16:10:20 -0400 Subject: [PATCH] use algo specified hash everywhere --- sgminer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sgminer.c b/sgminer.c index de1c5521..acecfe1f 100644 --- a/sgminer.c +++ b/sgminer.c @@ -1992,7 +1992,7 @@ static bool __build_gbt_txns(struct pool *pool, json_t *res_val) if (unlikely(!hex2bin(txn_bin, txn, txn_len / 2))) quit(1, "Failed to hex2bin txn_bin"); - gen_hash(txn_bin, txn_len / 2, pool->txn_hashes + (32 * i)); + pool->algorithm.gen_hash(txn_bin, txn_len / 2, pool->txn_hashes + (32 * i)); free(txn_bin); } out: @@ -2008,7 +2008,7 @@ static unsigned char *__gbt_merkleroot(struct pool *pool) if (unlikely(!merkle_hash)) quit(1, "Failed to calloc merkle_hash in __gbt_merkleroot"); - gen_hash(pool->coinbase, pool->coinbase_len, merkle_hash); + pool->algorithm.gen_hash(pool->coinbase, pool->coinbase_len, merkle_hash); if (pool->gbt_txns) memcpy(merkle_hash + 32, pool->txn_hashes, pool->gbt_txns * 32); @@ -2022,7 +2022,7 @@ static unsigned char *__gbt_merkleroot(struct pool *pool) for (i = 0; i < txns; i += 2){ unsigned char hashout[32]; - gen_hash(merkle_hash + (i * 32), 64, hashout); + pool->algorithm.gen_hash(merkle_hash + (i * 32), 64, hashout); memcpy(merkle_hash + (i / 2 * 32), hashout, 32); } txns /= 2;