Browse Source

whirlpool: allow stratum compat with new coins

make a difference between whirlpool and whirlcoin algos (stratum)

Look like the old SHA merkleroot method doesnt work on recent coins

Doesn't affect solo mining, only pools using stratum+tcp:// protocol
master
Tanguy Pruvot 9 years ago
parent
commit
42789f1a0d
  1. 7
      ccminer.cpp

7
ccminer.cpp

@ -117,6 +117,7 @@ enum sha_algos {
ALGO_X15, ALGO_X15,
ALGO_X17, ALGO_X17,
ALGO_WHIRLCOIN, ALGO_WHIRLCOIN,
ALGO_WHIRLPOOL,
ALGO_WHIRLPOOLX, ALGO_WHIRLPOOLX,
ALGO_ZR5, ALGO_ZR5,
ALGO_COUNT ALGO_COUNT
@ -155,6 +156,7 @@ static const char *algo_names[] = {
"x14", "x14",
"x15", "x15",
"x17", "x17",
"whirlcoin",
"whirlpool", "whirlpool",
"whirlpoolx", "whirlpoolx",
"zr5", "zr5",
@ -1378,6 +1380,7 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
case ALGO_WHIRLCOIN: case ALGO_WHIRLCOIN:
SHA256((uchar*)sctx->job.coinbase, sctx->job.coinbase_size, (uchar*)merkle_root); SHA256((uchar*)sctx->job.coinbase, sctx->job.coinbase_size, (uchar*)merkle_root);
break; break;
case ALGO_WHIRLPOOL:
default: default:
sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size);
} }
@ -1813,6 +1816,7 @@ static void *miner_thread(void *userdata)
case ALGO_X11: case ALGO_X11:
case ALGO_X13: case ALGO_X13:
case ALGO_WHIRLCOIN: case ALGO_WHIRLCOIN:
case ALGO_WHIRLPOOL:
minmax = 0x400000; minmax = 0x400000;
break; break;
case ALGO_LYRA2: case ALGO_LYRA2:
@ -1945,6 +1949,7 @@ static void *miner_thread(void *userdata)
rc = scanhash_s3(thr_id, &work, max_nonce, &hashes_done); rc = scanhash_s3(thr_id, &work, max_nonce, &hashes_done);
break; break;
case ALGO_WHIRLCOIN: case ALGO_WHIRLCOIN:
case ALGO_WHIRLPOOL:
rc = scanhash_whirl(thr_id, &work, max_nonce, &hashes_done); rc = scanhash_whirl(thr_id, &work, max_nonce, &hashes_done);
break; break;
case ALGO_WHIRLPOOLX: case ALGO_WHIRLPOOLX:
@ -2454,7 +2459,7 @@ void parse_arg(int key, char *arg)
else if (!strcasecmp("lyra2rev2", arg)) else if (!strcasecmp("lyra2rev2", arg))
i = opt_algo = ALGO_LYRA2v2; i = opt_algo = ALGO_LYRA2v2;
else if (!strcasecmp("whirl", arg)) else if (!strcasecmp("whirl", arg))
i = opt_algo = ALGO_WHIRLCOIN; i = opt_algo = ALGO_WHIRLPOOL;
else if (!strcasecmp("ziftr", arg)) else if (!strcasecmp("ziftr", arg))
i = opt_algo = ALGO_ZR5; i = opt_algo = ALGO_ZR5;
else else

Loading…
Cancel
Save