Browse Source

Only give remote block message on console once.

master
Con Kolivas 8 years ago
parent
commit
c6812b67ec
  1. 11
      src/stratifier.c

11
src/stratifier.c

@ -3424,7 +3424,6 @@ static void block_solve(ckpool_t *ckp, const char *blockhash)
json_get_int(&height, val, "height"); json_get_int(&height, val, "height");
json_get_double(&diff, val, "diff"); json_get_double(&diff, val, "diff");
if (ckp->remote) { if (ckp->remote) {
json_set_string(val, "name", ckp->name);
upstream_msgtype(ckp, val, SM_BLOCK); upstream_msgtype(ckp, val, SM_BLOCK);
json_decref(val); json_decref(val);
} else } else
@ -6731,16 +6730,14 @@ static void parse_remote_block(ckpool_t *ckp, sdata_t *sdata, json_t *val, const
int height = 0; int height = 0;
char *msg; char *msg;
name = json_string_value(name_val);
if (!name_val || !name)
goto out_add;
workername = json_string_value(workername_val); workername = json_string_value(workername_val);
if (unlikely(!workername_val || !workername)) { if (unlikely(!workername_val || !workername)) {
LOGWARNING("Failed to get workername from remote message %s", buf); LOGWARNING("Failed to get workername from remote message %s", buf);
workername = ""; workername = "";
} }
name = json_string_value(name_val);
if (unlikely(!name_val || !name)) {
LOGWARNING("Failed to get name from remote message %s", buf);
name = "";
}
if (unlikely(!json_get_int(&height, val, "height"))) if (unlikely(!json_get_int(&height, val, "height")))
LOGWARNING("Failed to get height from remote message %s", buf); LOGWARNING("Failed to get height from remote message %s", buf);
if (unlikely(!json_get_double(&diff, val, "diff"))) if (unlikely(!json_get_double(&diff, val, "diff")))
@ -6749,7 +6746,7 @@ static void parse_remote_block(ckpool_t *ckp, sdata_t *sdata, json_t *val, const
LOGWARNING("%s", msg); LOGWARNING("%s", msg);
stratum_broadcast_message(sdata, msg); stratum_broadcast_message(sdata, msg);
free(msg); free(msg);
out_add:
/* Make a duplicate for use by ckdbq_add */ /* Make a duplicate for use by ckdbq_add */
val = json_deep_copy(val); val = json_deep_copy(val);
ckdbq_add(ckp, ID_BLOCK, val); ckdbq_add(ckp, ID_BLOCK, val);

Loading…
Cancel
Save