|
|
@ -2950,22 +2950,22 @@ static void block_solve(ckpool_t *ckp, const char *blockhash) |
|
|
|
if (!found) { |
|
|
|
if (!found) { |
|
|
|
LOGINFO("Failed to find blockhash %s in block_solve, possibly from downstream", |
|
|
|
LOGINFO("Failed to find blockhash %s in block_solve, possibly from downstream", |
|
|
|
blockhash); |
|
|
|
blockhash); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
|
|
|
|
val = found->data; |
|
|
|
|
|
|
|
json_set_string(val, "confirmed", "1"); |
|
|
|
|
|
|
|
json_set_string(val, "createdate", cdfield); |
|
|
|
|
|
|
|
json_set_string(val, "createcode", __func__); |
|
|
|
|
|
|
|
json_get_int(&height, val, "height"); |
|
|
|
|
|
|
|
json_get_double(&diff, val, "diff"); |
|
|
|
|
|
|
|
ckdbq_add(ckp, ID_BLOCK, val); |
|
|
|
|
|
|
|
free(found); |
|
|
|
|
|
|
|
if (ckp->remote) |
|
|
|
|
|
|
|
upstream_block(ckp, height, workername, diff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val = found->data; |
|
|
|
if (!workername) { |
|
|
|
json_set_string(val, "confirmed", "1"); |
|
|
|
ASPRINTF(&msg, "Block solved by %s!", ckp->name); |
|
|
|
json_set_string(val, "createdate", cdfield); |
|
|
|
LOGWARNING("Solved and confirmed block!"); |
|
|
|
json_set_string(val, "createcode", __func__); |
|
|
|
|
|
|
|
json_get_int(&height, val, "height"); |
|
|
|
|
|
|
|
json_get_double(&diff, val, "diff"); |
|
|
|
|
|
|
|
ckdbq_add(ckp, ID_BLOCK, val); |
|
|
|
|
|
|
|
free(found); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (unlikely(!workername)) { |
|
|
|
|
|
|
|
/* This should be impossible! */ |
|
|
|
|
|
|
|
ASPRINTF(&msg, "Block %d solved by %s!", height, ckp->name); |
|
|
|
|
|
|
|
LOGWARNING("Solved and confirmed block %d", height); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
json_t *user_val, *worker_val; |
|
|
|
json_t *user_val, *worker_val; |
|
|
|
worker_instance_t *worker; |
|
|
|
worker_instance_t *worker; |
|
|
@ -2993,8 +2993,6 @@ static void block_solve(ckpool_t *ckp, const char *blockhash) |
|
|
|
} |
|
|
|
} |
|
|
|
stratum_broadcast_message(sdata, msg); |
|
|
|
stratum_broadcast_message(sdata, msg); |
|
|
|
free(msg); |
|
|
|
free(msg); |
|
|
|
if (ckp->remote) |
|
|
|
|
|
|
|
upstream_block(ckp, height, workername, diff); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(workername); |
|
|
|
free(workername); |
|
|
|
|
|
|
|
|
|
|
|