From 82f1fc0d5535eda3fc9eab799d81b3e220dbe4ef Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 20 May 2026 02:10:01 +0530 Subject: feat: add tollgate_core component + market config wiring - Add tollgate_core ESP-IDF component (skeleton: cashu, dns, firewall, session) - Add tollgate_platform.c with SPIFFS config backend - Wire market_enabled, market_scan_interval_s, client_auto_switch in config.c - Add lwip_tollgate_hooks.h (updated from feature branch) - Add E2E fix plan, tollgate_core design doc, WPA autodetect plan - Add integration test network helpers - Add CONSOLIDATION.md plan Reverts the broken merge (be4788b) that gutted config.c/tollgate_main.c/tollgate_api.c and replaces it with a clean addition on top of intact master. --- main/config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'main/config.c') 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) g_config.stratum_port = 3333; g_config.mining_port = 3334; g_config.mining_sandbox_mint_access = true; + g_config.market_enabled = true; + g_config.market_scan_interval_s = 30; + g_config.client_auto_switch = false; esp_vfs_spiffs_conf_t conf = { .base_path = "/spiffs", @@ -361,6 +364,15 @@ esp_err_t tollgate_config_init(void) if (m_sandbox && cJSON_IsBool(m_sandbox)) g_config.mining_sandbox_mint_access = cJSON_IsTrue(m_sandbox); } + cJSON *market_enabled = cJSON_GetObjectItem(root, "market_enabled"); + if (market_enabled && cJSON_IsBool(market_enabled)) g_config.market_enabled = cJSON_IsTrue(market_enabled); + + cJSON *market_scan_interval = cJSON_GetObjectItem(root, "market_scan_interval_s"); + if (market_scan_interval) g_config.market_scan_interval_s = market_scan_interval->valueint; + + cJSON *client_auto_switch = cJSON_GetObjectItem(root, "client_auto_switch"); + if (client_auto_switch && cJSON_IsBool(client_auto_switch)) g_config.client_auto_switch = cJSON_IsTrue(client_auto_switch); + cJSON_Delete(root); if (g_config.payout.recipient_count == 0) { -- cgit v1.2.3