From 5452725f1ae50b00a3143c2a717a5e836fffe259 Mon Sep 17 00:00:00 2001
From: Tony Butler <spudz76@gmail.com>
Date: Tue, 18 Dec 2018 19:04:16 -0700
Subject: [PATCH] Add Rig ID to connection status web+cli

---
 xmrstak/http/webdesign.cpp | 1 +
 xmrstak/misc/executor.cpp  | 2 ++
 xmrstak/net/jpsock.hpp     | 1 +
 3 files changed, 4 insertions(+)

diff --git a/xmrstak/http/webdesign.cpp b/xmrstak/http/webdesign.cpp
index 93e2175..30a8443 100644
--- a/xmrstak/http/webdesign.cpp
+++ b/xmrstak/http/webdesign.cpp
@@ -168,6 +168,7 @@ extern const char sHtmlHashrateBodyLow [] =
 extern const char sHtmlConnectionBodyHigh [] =
 	"<div class='data'>"
 	"<table>"
+		"<tr><th>Rig ID</th><td>%s</td></tr>"
 		"<tr><th>Pool address</th><td>%s</td></tr>"
 		"<tr><th>Connected since</th><td>%s</td></tr>"
 		"<tr><th>Pool ping time</th><td>%u ms</td></tr>"
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index a303b34..c77645f 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -945,6 +945,7 @@ void executor::connection_report(std::string& out)
 		pool = pick_pool_by_id(last_usr_pool_id);
 
 	out.append("CONNECTION REPORT\n");
+	out.append("Rig ID          : ").append(pool != nullptr ? pool->get_rigid() : "").append(1, '\n');
 	out.append("Pool address    : ").append(pool != nullptr ? pool->get_pool_addr() : "<not connected>").append(1, '\n');
 	if(pool != nullptr && pool->is_running() && pool->is_logged_in())
 		out.append("Connected since : ").append(time_format(date, sizeof(date), tPoolConnTime)).append(1, '\n');
@@ -1145,6 +1146,7 @@ void executor::http_connection_report(std::string& out)
 	}
 
 	snprintf(buffer, sizeof(buffer), sHtmlConnectionBodyHigh,
+		pool != nullptr ? pool->get_rigid() : "",
 		pool != nullptr ? pool->get_pool_addr() : "not connected",
 		cdate, ping_time);
 	out.append(buffer);
diff --git a/xmrstak/net/jpsock.hpp b/xmrstak/net/jpsock.hpp
index ad34f6c..96fec6b 100644
--- a/xmrstak/net/jpsock.hpp
+++ b/xmrstak/net/jpsock.hpp
@@ -58,6 +58,7 @@ public:
 	inline bool get_disconnects(size_t& att, size_t& time) { att = connect_attempts; time = disconnect_time != 0 ? get_timestamp() - disconnect_time + 1 : 0; return pool && usr_login[0]; }
 	inline const char* get_pool_addr() { return net_addr.c_str(); }
 	inline const char* get_tls_fp() { return tls_fp.c_str(); }
+	inline const char* get_rigid() { return usr_rigid.c_str(); }
 	inline bool is_nicehash() { return nicehash; }
 
 	bool get_pool_motd(std::string& strin);
-- 
GitLab