Skip to content

Commit

Permalink
remove unnecessary print out
Browse files Browse the repository at this point in the history
  • Loading branch information
djm34 committed Dec 9, 2018
1 parent 10176a3 commit 3a20a06
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions RUN-ZCOIN-MTP.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

rem x64\Release\ccminer -a mtp -o http://127.0.0.1:8382 -u djm34 -p password --coinbase-addr TJgLGLyGBSgeFuAT4iWaTtWeXDAjAr4ZS4 -d 1080 --no-getwork
x64\Release\ccminer -a mtp -o stratum+tcp://testnet.mintpond.com:3000 -u TRHRA2npoJQpPT2Sh5ieDyRec5asjRjhvD.gitworker -p 0 -d 1070#1 --debug --protocol-dump
rem x64\Release\ccminer -a mtp -o stratum+tcp://testnet.mintpond.com:3000 -u TVdKb9mjRdJbETtxPajnWjnmB8ZPaF43eU.reb -p 0 -d 0 --debug --protocol-dump
rem x64\Release\ccminer -a mtp -o http://127.0.0.1:8382 -u djm34 -p password --coinbase-addr aChWVb8CpgajadpLmiwDZvZaKizQgHxfh5-d 1080 --no-getwork
x64\Release\ccminer -a mtp -o stratum+tcp://testnet.mintpond.com:3000 -u TJgLGLyGBSgeFuAT4iWaTtWeXDAjAr4ZS4 -p 0 -d 1070

pause
26 changes: 13 additions & 13 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ struct workio_cmd {
int pooln;
};

bool opt_debug = true;
bool opt_debug_diff = true;
bool opt_debug_threads = true;
bool opt_debug = false;
bool opt_debug_diff = false;
bool opt_debug_threads = false;
bool opt_protocol = false;
bool opt_benchmark = false;
bool opt_showdiff = true;
Expand Down Expand Up @@ -1386,7 +1386,7 @@ static bool gbt_work_decode(const json_t *val, struct work *work)
// build coinbase transaction
tmp = json_object_get(val, "coinbasetxn");
if (tmp) {
printf("printf coinbase txn\n");
//printf("printf coinbase txn\n");
const char *cbtx_hex = json_string_value(json_object_get(tmp, "data"));
cbtx_size = cbtx_hex ? (int)strlen(cbtx_hex) / 2 : 0;
cbtx = (uchar*)malloc(cbtx_size + 100);
Expand Down Expand Up @@ -2587,8 +2587,8 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
work->xnonce2_len = sctx->xnonce2_size;
memcpy(work->xnonce2, sctx->job.xnonce2, sctx->xnonce2_size);

printf("thefull job id %s\n",work->job_id);
printf("reduced job id %s\n", work->job_id+8);
// printf("thefull job id %s\n",work->job_id);
// printf("reduced job id %s\n", work->job_id+8);

// also store the block number
work->height = sctx->job.height;
Expand Down Expand Up @@ -2682,10 +2682,10 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
work->data[18] = le32dec(sctx->job.nbits);
work->data[20] = 0x00100000;

for (int k = 0; k < 20; k++) {
printf(" %08x", work->data[k]);
}
printf("\n");
// for (int k = 0; k < 20; k++) {
// printf(" %08x", work->data[k]);
// }
// printf("\n");
} else {
for (i = 0; i < 8; i++)
work->data[9 + i] = be32dec((uint32_t *)merkle_root + i);
Expand Down Expand Up @@ -2835,7 +2835,7 @@ static bool wanna_mine(int thr_id)

static void *miner_thread(void *userdata)
{
printf("entering miner thread\n");
//printf("entering miner thread\n");
struct thr_info *mythr = (struct thr_info *)userdata;
struct mtp * mtp = (struct mtp*)malloc(sizeof(struct mtp));
int switchn = pool_switch_count;
Expand Down Expand Up @@ -3895,7 +3895,7 @@ static bool stratum_handle_response_json(json_t *val)

valid = json_is_true(res_val);

printf("err_val %s",json_dumps(err_val,0));
// printf("err_val %s",json_dumps(err_val,0));
share_result(valid, stratum.pooln, stratum.sharediff, err_val ? json_string_value(json_array_get(err_val, 1)) : NULL);


Expand Down Expand Up @@ -4023,7 +4023,7 @@ static void *stratum_thread(void *userdata)

if (stratum.job.clean) {

printf("stratum job clean\n");
// printf("stratum job clean\n");
static uint32_t last_bloc_height;
if (!opt_quiet && stratum.job.height != last_bloc_height) {
last_bloc_height = stratum.job.height;
Expand Down
4 changes: 2 additions & 2 deletions cuda_mtp/mtp.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" int scanhash_mtp(int thr_id, struct work* work, uint32_t max_nonce, u
// unsigned char TheMerkleRoot[16];
unsigned char mtpHashValue[32];
// MerkleTree::Elements TheElements; // = new MerkleTree;
printf("the job_id from mtp %s\n",work->job_id+8);
//printf("the job_id from mtp %s\n",work->job_id+8);
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
const uint32_t first_nonce = pdata[19];
Expand Down Expand Up @@ -165,7 +165,7 @@ do {
memcpy(mtp->nProofMTP, nProofMTP, sizeof(unsigned char)* MTP_L * 3 * 353);


printf("found a solution, nonce %08x\n",pdata[19]);
// printf("found a solution, nonce %08x\n",pdata[19]);
// free_memory(&context, (unsigned char *)instance.memory, instance.memory_blocks, sizeof(block));

return res;
Expand Down
22 changes: 11 additions & 11 deletions util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ json_t* recode_message(json_t *MyObject2)

json_t *stratum_recv_line_bos(struct stratum_ctx *sctx)
{
printf("stratum_recv_line_bos\n");
// printf("stratum_recv_line_bos\n");
json_t *MyObject2 = json_object();
json_t *MyObject = json_object();
ssize_t len, buflen;
Expand Down Expand Up @@ -1461,7 +1461,7 @@ char *stratum_recv_line_boschar(struct stratum_ctx *sctx)
time_t rstart = time(NULL);


printf("stratum_recv_line_boschar\n");
//printf("stratum_recv_line_boschar\n");
do {
char s[RBUFSIZE];
ssize_t n = 0;
Expand Down Expand Up @@ -1563,7 +1563,7 @@ printf("stratum_recv_line_boschar\n");

bool stratum_recv_line_compact(struct stratum_ctx *sctx)
{
printf("stratum_recv_line_compact\n");
// printf("stratum_recv_line_compact\n");
json_t *MyObject2 = json_object();
json_t *MyObject = json_object();
ssize_t len, buflen;
Expand Down Expand Up @@ -1621,15 +1621,15 @@ bool stratum_recv_line_compact(struct stratum_ctx *sctx)
}

out:
printf("end stratum_recv_line_compact\n");
// printf("end stratum_recv_line_compact\n");
// if (sret && opt_protocol)
// applog(LOG_DEBUG, "< %s", sret);
return isok;//json_dumps(MyObject, 0);
}

json_t* stratum_recv_line_c2(struct stratum_ctx *sctx)
{
printf("stratum_recv_line_c2\n");
// printf("stratum_recv_line_c2\n");
json_t *MyObject = json_object();
ssize_t len, buflen;
ssize_t mess;
Expand Down Expand Up @@ -2249,7 +2249,7 @@ bool stratum_authorize_bos(struct stratum_ctx *sctx, const char *user, const cha
goto out;
}
while (1) {
printf("coming here\n");
// printf("coming here\n");
if (!stratum_recv_line_compact(sctx))
break;
}
Expand Down Expand Up @@ -2435,7 +2435,7 @@ static bool stratum_notify_bos(struct stratum_ctx *sctx, json_t *params)
job_id = (const uchar*)json_bytes_value(json_array_get(params, p++));

// memcpy(sctx->job.ucjob_id, job_id, job_idsize);
printf("before merkle count job_idsize %d %08x\n",job_idsize,((uint32_t*)job_id)[0]);
// printf("before merkle count job_idsize %d %08x\n",job_idsize,((uint32_t*)job_id)[0]);
prevhash = (const uchar*)json_bytes_value(json_array_get(params, p++));

coinb1 = (const uchar*)json_bytes_value(json_array_get(params, p));
Expand Down Expand Up @@ -2493,7 +2493,7 @@ static bool stratum_notify_bos(struct stratum_ctx *sctx, json_t *params)
memcpy(sctx->job.xnonce2 + sctx->xnonce2_size, coinb2, coinb2_size);


printf("before job_id\n");
//printf("before job_id\n");
free(sctx->job.job_id);
// sctx->job.job_id = job_id;
sctx->job.job_id = (char*)malloc(2 * job_idsize + 1);
Expand Down Expand Up @@ -3088,7 +3088,7 @@ bool stratum_handle_method_bos(struct stratum_ctx *sctx, const char *s)
bool stratum_handle_method_bos_json(struct stratum_ctx *sctx, json_t *val)
{

printf("stratum_handle_method_bos_json\n");
//printf("stratum_handle_method_bos_json\n");
json_t *id, *params;
json_error_t err;
const char *method;
Expand All @@ -3103,9 +3103,9 @@ printf("stratum_handle_method_bos_json\n");
id = json_object_get(val, "id");

if (!strcasecmp(method, "mining.notify")) {
printf("mining.notify\n");
// printf("mining.notify\n");
ret = stratum_notify_bos(sctx, params);
printf("end mining.notify\n");
// printf("end mining.notify\n");
goto out;
}
if (!strcasecmp(method, "mining.set_target")) {
Expand Down

0 comments on commit 3a20a06

Please sign in to comment.