Browse Source

Merge commit '617ee96' into stratum

Conflicts:
	API-README
Luke Dashjr 13 years ago
parent
commit
6bfed8faef
2 changed files with 17 additions and 1 deletions
  1. 7 0
      API-README
  2. 10 1
      api.c

+ 7 - 0
API-README

@@ -384,6 +384,13 @@ miner.php - an example web page to access the API
 Feature Changelog for external applications using the API:
 
 
+API V1.20
+
+Modified API commands:
+ 'pools' - add 'Has Stratum', 'Stratum Active', 'Stratum URL'
+
+----------
+
 API V1.19b (BFGMiner v2.8.1)
 
 Added API commands:

+ 10 - 1
api.c

@@ -131,7 +131,7 @@ static const char SEPARATOR = '|';
 #define SEPSTR "|"
 static const char GPUSEP = ',';
 
-static const char *APIVERSION = "1.19";
+static const char *APIVERSION = "1.20";
 static const char *DEAD = "Dead";
 static const char *SICK = "Sick";
 static const char *NOSTART = "NoStart";
@@ -1730,6 +1730,9 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 	for (i = 0; i < total_pools; i++) {
 		struct pool *pool = pools[i];
 
+		if (pool->removed)
+			continue;
+
 		switch (pool->enabled) {
 			case POOL_DISABLED:
 				status = (char *)DISABLED;
@@ -1777,6 +1780,12 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 		root = api_add_diff(root, "Difficulty Rejected", &(pool->diff_rejected), false);
 		root = api_add_diff(root, "Difficulty Stale", &(pool->diff_stale), false);
 		root = api_add_diff(root, "Last Share Difficulty", &(pool->last_share_diff), false);
+		root = api_add_bool(root, "Has Stratum", &(pool->has_stratum), false);
+		root = api_add_bool(root, "Stratum Active", &(pool->stratum_active), false);
+		if (pool->stratum_active)
+			root = api_add_escape(root, "Stratum URL", pool->stratum_url, false);
+		else
+			root = api_add_const(root, "Stratum URL", BLANK, false);
 
 		if (isjson && (i > 0))
 			strcat(io_buffer, COMMA);