Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
okoto-xyz committed Dec 29, 2018
2 parents 842c75c + 2814f85 commit e5f6b81
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
5 changes: 4 additions & 1 deletion cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ static bool gbt_work_decode(const json_t *val, struct work *work)
goto out;
}
sha256d(merkle_tree[1 + i], tx, tx_size);
free(tx);
if (!submit_coinbase)
strcat(work->txs, tx_hex);
}
Expand Down Expand Up @@ -628,7 +629,7 @@ static bool gbt_work_decode(const json_t *val, struct work *work)
if (!have_longpoll) {
char *lp_uri;
tmp = json_object_get(val, "longpolluri");
lp_uri = json_is_string(tmp) ? strdup(json_string_value(tmp)) : rpc_url;
lp_uri = strdup(json_is_string(tmp) ? json_string_value(tmp) : rpc_url);
have_longpoll = true;
tq_push(thr_info[longpoll_thr_id].q, lp_uri);
}
Expand Down Expand Up @@ -1155,6 +1156,7 @@ static void *miner_thread(void *userdata)
if (!have_stratum &&
(time(NULL) - g_work_time >= min_scantime ||
work.data[19] >= end_nonce)) {
work_free(&g_work);
if (unlikely(!get_work(mythr, &g_work))) {
applog(LOG_ERR, "work retrieval failed, exiting "
"mining thread %d", mythr->id);
Expand Down Expand Up @@ -1325,6 +1327,7 @@ static void *longpoll_thread(void *userdata)
soval = json_object_get(res, "submitold");
submit_old = soval ? json_is_true(soval) : false;
pthread_mutex_lock(&g_work_lock);
work_free(&g_work);
if (have_gbt)
rc = gbt_work_decode(res, &g_work);
else
Expand Down
1 change: 1 addition & 0 deletions winbuild-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CFLAGS="-Wall -O3 -fomit-frame-pointer"
mkdir release
cp README.txt release/
#cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll release/
#cp /usr/lib/gcc/i686-w64-mingw32/5.3-win32/libgcc_s_sjlj-1.dll release/
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll release/
cp curl/lib/.libs/libcurl-4.dll release/

Expand Down
2 changes: 1 addition & 1 deletion yescrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int scanhash_yescrypt(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
yescrypt_hash_sp((unsigned char*) &endiandata, (unsigned char*) hash64);
yescrypt_hash_sp((unsigned char*) &endiandata, perslen, (unsigned char*) hash64);
if ((hash64[7] < ptarget[7]) || ((hash64[7] == ptarget[7]) && (hash64[6] < ptarget[6])) &&
fulltest(hash64, ptarget)) {
*hashes_done = n - first_nonce + 1;
Expand Down
4 changes: 2 additions & 2 deletions yescrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ extern "C" {
#endif


extern void yescrypt_hash_sp(const char *input, char *output);
extern void yescrypt_hash(const char *input, char *output);
extern void yescrypt_hash_sp(const char *input, int inputlen, char *output);
extern void yescrypt_hash(const char *input, int inputlen, char *output);



Expand Down
8 changes: 4 additions & 4 deletions yescryptcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@ yescrypt_bsty(const uint8_t * passwd, size_t passwdlen,
return retval;
}

void yescrypt_hash_sp(const char *input, char *output)
void yescrypt_hash_sp(const char *input, int inputlen, char *output)
{
yescrypt_bsty((const uint8_t *)input, 80, (const uint8_t *) input, 80, 2048, 8, 1, (uint8_t *)output, 32);
yescrypt_bsty((const uint8_t *)input, inputlen, (const uint8_t *) input, inputlen, 2048, 8, 1, (uint8_t *)output, 32);
}

void yescrypt_hash(const char *input, char *output)
void yescrypt_hash(const char *input, int inputlen, char *output)
{
yescrypt_hash_sp(input, output);
yescrypt_hash_sp(input, inputlen, output);
}

0 comments on commit e5f6b81

Please sign in to comment.