Browse Source

config: write pool name and description to config.

refactor
Noel Maersk 11 years ago
parent
commit
da667d63e0
  1. 3
      pool.c
  2. 7
      sgminer.c

3
pool.c

@ -22,9 +22,6 @@ @@ -22,9 +22,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file was originally written by Colin Percival as part of the Tarsnap
* online backup system.
*/
#include "config.h"

7
sgminer.c

@ -4274,6 +4274,13 @@ void write_config(FILE *fcfg) @@ -4274,6 +4274,13 @@ void write_config(FILE *fcfg)
for(i = 0; i < total_pools; i++) {
struct pool *pool = pools[i];
/* Using get_pool_name() here is unsafe if opt_incognito is true. */
if (strcmp(pool->name, "") != 0) {
fprintf(fcfg, "\n\t\t\"name\" : \"%s\",", json_escape(pool->name));
}
if (strcmp(pool->description, "") != 0) {
fprintf(fcfg, "\n\t\t\"description\" : \"%s\",", json_escape(pool->description));
}
if (pool->quota != 1) {
fprintf(fcfg, "%s\n\t{\n\t\t\"quota\" : \"%s%s%s%d;%s\",", i > 0 ? "," : "",
pool->rpc_proxy ? json_escape((char *)proxytype(pool->rpc_proxytype)) : "",

Loading…
Cancel
Save