Commit aa6aa29c4d723367a9eca7f02c4d8f6d182e6672

Con Kolivas 2012-09-29T17:06:48

Check that stratum is already active in initiate_stratum to avoid de-authorising ourselves by subscribing again.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/util.c b/util.c
index b5888ea..d31167e 100644
--- a/util.c
+++ b/util.c
@@ -1170,6 +1170,9 @@ bool initiate_stratum(struct pool *pool)
 	json_error_t err;
 	bool ret = false;
 
+	if (pool->stratum_active)
+		return true;
+
 	s = alloca(RECVSIZE);
 	sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);