diff options
| author | Your Name <you@example.com> | 2026-05-18 14:50:41 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-18 14:50:41 +0530 |
| commit | 2a86bec93273e2f4ceeab60683058c65dbb1da3d (patch) | |
| tree | 56e66acc4eaa0b5a947bb78d28e494a0adc857e2 /main/cashu.c | |
| parent | 0c3f08ac7cf8e970369ec137153107ca8edc3326 (diff) | |
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
Diffstat (limited to 'main/cashu.c')
| -rw-r--r-- | main/cashu.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ | |||
| 1 | #include "cashu.h" | 1 | #include "cashu.h" |
| 2 | #include "config.h" | 2 | #include "config.h" |
| 3 | #include "mint_health.h" | ||
| 3 | #include "esp_log.h" | 4 | #include "esp_log.h" |
| 4 | #include "esp_http_client.h" | 5 | #include "esp_http_client.h" |
| 5 | #include "cJSON.h" | 6 | #include "cJSON.h" |
| @@ -268,8 +269,10 @@ bool cashu_is_mint_accepted(const char *mint_url) | |||
| 268 | if (!mint_url || mint_url[0] == '\0') return false; | 269 | if (!mint_url || mint_url[0] == '\0') return false; |
| 269 | const tollgate_config_t *cfg = tollgate_config_get(); | 270 | const tollgate_config_t *cfg = tollgate_config_get(); |
| 270 | for (int i = 0; i < cfg->accepted_mint_count; i++) { | 271 | for (int i = 0; i < cfg->accepted_mint_count; i++) { |
| 271 | if (strstr(mint_url, cfg->accepted_mints[i]) != NULL) return true; | 272 | if (strstr(mint_url, cfg->accepted_mints[i]) != NULL || |
| 272 | if (strcmp(mint_url, cfg->accepted_mints[i]) == 0) return true; | 273 | strcmp(mint_url, cfg->accepted_mints[i]) == 0) { |
| 274 | return mint_health_is_reachable(mint_url); | ||
| 275 | } | ||
| 273 | } | 276 | } |
| 274 | return false; | 277 | return false; |
| 275 | } | 278 | } |