Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase stratum proxy difficulty to 16 for SHA256 clients. #456

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions driver-stratum.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void stratumsrv_mining_subscribe(struct bufferevent *bev, json_t *params, const
if (opt_scrypt)
bufferevent_write(bev, "0.000015258556232", 17);
else
bufferevent_write(bev, "0.9999847412109375", 18);
bufferevent_write(bev, "15.999755859375", 15);
bufferevent_write(bev, "],\"id\":null,\"method\":\"mining.set_difficulty\"}\n", 46);
bufferevent_write(bev, _ssm_notify, _ssm_notify_sz);
}
Expand Down Expand Up @@ -373,7 +373,7 @@ void stratumsrv_mining_submit(struct bufferevent *bev, json_t *params, const cha
const char * const nonce = __json_array_string(params, 4);
uint8_t xnonce2[work2d_xnonce2sz];
uint32_t ntime_n, nonce_n;
const float nonce_diff = opt_scrypt ? (1./0x10000) : 1.;
const float nonce_diff = opt_scrypt ? (1./0x10000) : 16.;
bool is_stale;

if (unlikely(!client))
Expand Down Expand Up @@ -416,7 +416,7 @@ void stratumsrv_mining_submit(struct bufferevent *bev, json_t *params, const cha
timer_set_now(&tv_now);
timersub(&tv_now, &conn->tv_hashes_done, &tv_delta);
conn->tv_hashes_done = tv_now;
const uint64_t hashes = opt_scrypt ? 0x10000 : 0x100000000;
const uint64_t hashes = opt_scrypt ? 0x10000 : 0x1000000000;
hashes_done(thr, hashes, &tv_delta, NULL);
}
}
Expand Down Expand Up @@ -619,4 +619,4 @@ void stratumsrv_start()
pthread_t pth;
if (unlikely(pthread_create(&pth, NULL, stratumsrv_thread, NULL)))
quit(1, "stratumsrv thread create failed");
}
}