Browse Source

SSM: If no notify is currently set, try to set it before refusing a subscribe

Luke Dashjr 12 years ago
parent
commit
44206b1e5a
1 changed files with 6 additions and 1 deletions
  1. 6 1
      driver-stratum.c

+ 6 - 1
driver-stratum.c

@@ -334,7 +334,12 @@ void stratumsrv_mining_subscribe(struct bufferevent *bev, json_t *params, const
 	int bufsz;
 	
 	if (!_ssm_notify)
-		return_stratumsrv_failure(20, "No notify set (upstream not stratum?)");
+	{
+		evtimer_del(ev_notify);
+		_stratumsrv_update_notify(-1, 0, NULL);
+		if (!_ssm_notify)
+			return_stratumsrv_failure(20, "No notify set (upstream not stratum?)");
+	}
 	
 	if (!*xnonce1_p)
 	{