From 2a86bec93273e2f4ceeab60683058c65dbb1da3d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 May 2026 14:50:41 +0530 Subject: feat: multi-mint health tracker, discovery, portal, multi-wallet (Phase 3-8) - mint_health.h/c: FreeRTOS probing task, GET /v1/info every 5min, recovery threshold 3, immediate failure, mutex-protected state - cashu.c: health-gated acceptance (config match AND reachable) - tollgate_api.c: one price_per_step tag per reachable mint in discovery - captive_portal.c: mint list with green/grey indicators, /mints API, auto-refresh every 30s via JS - nucula_wallet.h/cpp: multi-wallet (up to 4), route receive to correct wallet by mint URL, balance sums across all wallets - tollgate_main.c: init health tracker + multi-wallet on service start - CMakeLists.txt: add mint_health.c --- main/cashu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'main/cashu.c') diff --git a/main/cashu.c b/main/cashu.c index 2912d1d..da12ff9 100644 --- a/main/cashu.c +++ b/main/cashu.c @@ -1,5 +1,6 @@ #include "cashu.h" #include "config.h" +#include "mint_health.h" #include "esp_log.h" #include "esp_http_client.h" #include "cJSON.h" @@ -268,8 +269,10 @@ bool cashu_is_mint_accepted(const char *mint_url) if (!mint_url || mint_url[0] == '\0') return false; const tollgate_config_t *cfg = tollgate_config_get(); for (int i = 0; i < cfg->accepted_mint_count; i++) { - if (strstr(mint_url, cfg->accepted_mints[i]) != NULL) return true; - if (strcmp(mint_url, cfg->accepted_mints[i]) == 0) return true; + if (strstr(mint_url, cfg->accepted_mints[i]) != NULL || + strcmp(mint_url, cfg->accepted_mints[i]) == 0) { + return mint_health_is_reachable(mint_url); + } } return false; } -- cgit v1.2.3