diff options
| author | Your Name <you@example.com> | 2026-05-19 13:21:25 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 13:31:08 +0530 |
| commit | eeba74a4a1c011e85e33dea4252b381e35a64ea4 (patch) | |
| tree | 14862e7d300511e28e214c743fd2f699bc54c5b8 /main/cashu.c | |
| parent | b0d9d494f00ee77f9efc22d1ef2ea3c94b23ddbd (diff) | |
feat: multi-mint wallet with health tracking, WPA auto-detect, display gating
Squash merge of feature/multi-mint-support (21 commits):
Multi-mint wallet:
- Accept payments from 4 mints: minibits, coinos, 21mint, lnvoltz
- Periodic health probing (300s interval, 3 recovery threshold)
- Multi-wallet init with nucula_wallet_init_multi()
- /mints and /wallet API endpoints
WPA auto-detect:
- wifi_auth_mode config field (default WPA2, supports WPA3)
- Runtime mapping to wifi_auth_mode_t in STA config
Display gating:
- display_enabled config field (default true)
- Guards display_init/display_update per-board
Bug fixes:
- 3s delay before service start prevents lwip mem_free assertion
- Real npub in discovery (identity_get()->npub_hex)
- Health probe interval 300s (production value)
- Duplicate services_start_task call removed
- UTF-8 arrow replaced with ASCII in log message
Tests: 61+14 unit tests passing, firmware builds clean
Diffstat (limited to 'main/cashu.c')
| -rw-r--r-- | main/cashu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/cashu.c b/main/cashu.c index ec0566c..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" |
| @@ -267,6 +268,11 @@ bool cashu_is_mint_accepted(const char *mint_url) | |||
| 267 | { | 268 | { |
| 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 | if (strstr(mint_url, cfg->mint_url) != NULL) return true; | 271 | for (int i = 0; i < cfg->accepted_mint_count; i++) { |
| 271 | return (strcmp(mint_url, cfg->mint_url) == 0); | 272 | if (strstr(mint_url, cfg->accepted_mints[i]) != NULL || |
| 273 | strcmp(mint_url, cfg->accepted_mints[i]) == 0) { | ||
| 274 | return mint_health_is_reachable(mint_url); | ||
| 275 | } | ||
| 276 | } | ||
| 277 | return false; | ||
| 272 | } | 278 | } |