diff options
Diffstat (limited to 'main/config.c')
| -rw-r--r-- | main/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c index aa7da6d..43ab2a7 100644 --- a/main/config.c +++ b/main/config.c | |||
| @@ -46,6 +46,9 @@ esp_err_t tollgate_config_init(void) | |||
| 46 | g_config.stratum_port = 3333; | 46 | g_config.stratum_port = 3333; |
| 47 | g_config.mining_port = 3334; | 47 | g_config.mining_port = 3334; |
| 48 | g_config.mining_sandbox_mint_access = true; | 48 | g_config.mining_sandbox_mint_access = true; |
| 49 | g_config.market_enabled = true; | ||
| 50 | g_config.market_scan_interval_s = 30; | ||
| 51 | g_config.client_auto_switch = false; | ||
| 49 | 52 | ||
| 50 | esp_vfs_spiffs_conf_t conf = { | 53 | esp_vfs_spiffs_conf_t conf = { |
| 51 | .base_path = "/spiffs", | 54 | .base_path = "/spiffs", |
| @@ -361,6 +364,15 @@ esp_err_t tollgate_config_init(void) | |||
| 361 | if (m_sandbox && cJSON_IsBool(m_sandbox)) g_config.mining_sandbox_mint_access = cJSON_IsTrue(m_sandbox); | 364 | if (m_sandbox && cJSON_IsBool(m_sandbox)) g_config.mining_sandbox_mint_access = cJSON_IsTrue(m_sandbox); |
| 362 | } | 365 | } |
| 363 | 366 | ||
| 367 | cJSON *market_enabled = cJSON_GetObjectItem(root, "market_enabled"); | ||
| 368 | if (market_enabled && cJSON_IsBool(market_enabled)) g_config.market_enabled = cJSON_IsTrue(market_enabled); | ||
| 369 | |||
| 370 | cJSON *market_scan_interval = cJSON_GetObjectItem(root, "market_scan_interval_s"); | ||
| 371 | if (market_scan_interval) g_config.market_scan_interval_s = market_scan_interval->valueint; | ||
| 372 | |||
| 373 | cJSON *client_auto_switch = cJSON_GetObjectItem(root, "client_auto_switch"); | ||
| 374 | if (client_auto_switch && cJSON_IsBool(client_auto_switch)) g_config.client_auto_switch = cJSON_IsTrue(client_auto_switch); | ||
| 375 | |||
| 364 | cJSON_Delete(root); | 376 | cJSON_Delete(root); |
| 365 | 377 | ||
| 366 | if (g_config.payout.recipient_count == 0) { | 378 | if (g_config.payout.recipient_count == 0) { |