mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-10 14:04:16 +00:00
Add message to share if it's a resubmit.
This commit is contained in:
parent
b622e97e3e
commit
69d8c339aa
18
cgminer.c
18
cgminer.c
@ -1742,7 +1742,7 @@ static void reject_pool(struct pool *pool)
|
|||||||
pool->enabled = POOL_REJECTING;
|
pool->enabled = POOL_REJECTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool submit_upstream_work(const struct work *work, CURL *curl)
|
static bool submit_upstream_work(const struct work *work, CURL *curl, bool resubmit)
|
||||||
{
|
{
|
||||||
char *hexstr = NULL;
|
char *hexstr = NULL;
|
||||||
json_t *val, *res;
|
json_t *val, *res;
|
||||||
@ -1817,11 +1817,11 @@ static bool submit_upstream_work(const struct work *work, CURL *curl)
|
|||||||
applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
|
applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
|
||||||
if (!QUIET) {
|
if (!QUIET) {
|
||||||
if (total_pools > 1)
|
if (total_pools > 1)
|
||||||
applog(LOG_NOTICE, "Accepted %s %s %d pool %d",
|
applog(LOG_NOTICE, "Accepted %s %s %d pool %d %s",
|
||||||
hashshow, cgpu->api->name, cgpu->device_id, work->pool->pool_no);
|
hashshow, cgpu->api->name, cgpu->device_id, work->pool->pool_no, resubmit ? "(resubmit)" : "");
|
||||||
else
|
else
|
||||||
applog(LOG_NOTICE, "Accepted %s %s %d",
|
applog(LOG_NOTICE, "Accepted %s %s %d %s",
|
||||||
hashshow, cgpu->api->name, cgpu->device_id);
|
hashshow, cgpu->api->name, cgpu->device_id, resubmit ? "(resubmit)" : "");
|
||||||
}
|
}
|
||||||
sharelog("accept", work);
|
sharelog("accept", work);
|
||||||
if (opt_shares && total_accepted >= opt_shares) {
|
if (opt_shares && total_accepted >= opt_shares) {
|
||||||
@ -1870,8 +1870,8 @@ static bool submit_upstream_work(const struct work *work, CURL *curl)
|
|||||||
} else
|
} else
|
||||||
strcpy(reason, "");
|
strcpy(reason, "");
|
||||||
|
|
||||||
applog(LOG_NOTICE, "Rejected %s %s %d %s%s",
|
applog(LOG_NOTICE, "Rejected %s %s %d %s%s %s",
|
||||||
hashshow, cgpu->api->name, cgpu->device_id, where, reason);
|
hashshow, cgpu->api->name, cgpu->device_id, where, reason, resubmit ? "(resubmit)" : "");
|
||||||
sharelog(disposition, work);
|
sharelog(disposition, work);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2520,6 +2520,7 @@ static void *submit_work_thread(void *userdata)
|
|||||||
struct workio_cmd *wc = (struct workio_cmd *)userdata;
|
struct workio_cmd *wc = (struct workio_cmd *)userdata;
|
||||||
struct work *work = wc->work;
|
struct work *work = wc->work;
|
||||||
struct pool *pool = work->pool;
|
struct pool *pool = work->pool;
|
||||||
|
bool resubmit = false;
|
||||||
struct curl_ent *ce;
|
struct curl_ent *ce;
|
||||||
|
|
||||||
pthread_detach(pthread_self());
|
pthread_detach(pthread_self());
|
||||||
@ -2545,7 +2546,8 @@ static void *submit_work_thread(void *userdata)
|
|||||||
|
|
||||||
ce = pop_curl_entry(pool);
|
ce = pop_curl_entry(pool);
|
||||||
/* submit solution to bitcoin via JSON-RPC */
|
/* submit solution to bitcoin via JSON-RPC */
|
||||||
while (!submit_upstream_work(work, ce->curl)) {
|
while (!submit_upstream_work(work, ce->curl, resubmit)) {
|
||||||
|
resubmit = true;
|
||||||
if (stale_work(work, true)) {
|
if (stale_work(work, true)) {
|
||||||
applog(LOG_NOTICE, "Share became stale while retrying submit, discarding");
|
applog(LOG_NOTICE, "Share became stale while retrying submit, discarding");
|
||||||
total_stale++;
|
total_stale++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user