diff --git a/src/stratifier.c b/src/stratifier.c index d68bbdac..0a2c2d34 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -155,6 +155,8 @@ static struct { int nonce2len; int enonce2varlen; + + bool subscribed; } proxy_base; static int64_t workbase_id; @@ -760,6 +762,7 @@ static bool update_subscribe(ckpool_t *ckp) free(buf); ck_wlock(&workbase_lock); + proxy_base.subscribed = true; proxy_base.diff = ckp->startdiff; /* Length is checked by generator */ strcpy(proxy_base.enonce1, json_string_value(json_object_get(val, "enonce1"))); @@ -794,6 +797,11 @@ static void update_notify(ckpool_t *ckp) return; } + if (unlikely(!proxy_base.subscribed)) { + LOGINFO("No valid proxy subscription to update notify yet"); + return; + } + LOGDEBUG("Update notify: %s", buf); wb = ckzalloc(sizeof(workbase_t)); val = json_loads(buf, 0, NULL);