Browse Source

Bugfix: Stratum: Return correct error/result type for stratum mining.set_goal

Luke Dashjr 4 years ago
parent
commit
492c7765e7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      util.c

+ 2 - 2
util.c

@@ -2813,9 +2813,9 @@ bool stratum_set_goal(struct pool * const pool, json_t * const val, json_t * con
 		char * const idstr = json_dumps_ANY(j_id, 0);
 		char buf[0x80];
 		if (unlikely(emsg))
-			snprintf(buf, sizeof(buf), "{\"id\":%s,\"result\":true,\"error\":null}", idstr);
-		else
 			snprintf(buf, sizeof(buf), "{\"id\":%s,\"result\":null,\"error\":[-1,\"%s\",null]}", idstr, emsg);
+		else
+			snprintf(buf, sizeof(buf), "{\"id\":%s,\"result\":true,\"error\":null}", idstr);
 		free(idstr);
 		stratum_send(pool, buf, strlen(buf));
 	}