Browse Source

Reset shares after remote block solves and broadcast remote block solves

master
Con Kolivas 9 years ago
parent
commit
a3d7ed2a29
  1. 16
      src/stratifier.c

16
src/stratifier.c

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

Loading…
Cancel
Save