upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/cashu.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 14:37:29 +0530
committerYour Name <you@example.com>2026-05-18 14:37:29 +0530
commitb9477ef84e14f473793391a2b1d61ccb58c8de0d (patch)
tree9ff2d6a89c8527c85b5fc8fa7e56936b2fc1afbf /main/cashu.c
parentd7e27c66ef9c263ca6d3cf5d2eebe5e6443d6972 (diff)
feat: multi-mint config array and acceptance check (Phase 1+2)
- config.h: increase TOLLGATE_MAX_MINT_URLS to 8, add accepted_mints[] to config struct - config.c: parse accepted_mints JSON array, fallback to mint_url for backward compat - cashu.c: cashu_is_mint_accepted() iterates accepted_mints[] instead of single mint_url
Diffstat (limited to 'main/cashu.c')
-rw-r--r--main/cashu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/cashu.c b/main/cashu.c
index ec0566c..2912d1d 100644
--- a/main/cashu.c
+++ b/main/cashu.c
@@ -267,6 +267,9 @@ bool cashu_is_mint_accepted(const char *mint_url)
267{ 267{
268 if (!mint_url || mint_url[0] == '\0') return false; 268 if (!mint_url || mint_url[0] == '\0') return false;
269 const tollgate_config_t *cfg = tollgate_config_get(); 269 const tollgate_config_t *cfg = tollgate_config_get();
270 if (strstr(mint_url, cfg->mint_url) != NULL) return true; 270 for (int i = 0; i < cfg->accepted_mint_count; i++) {
271 return (strcmp(mint_url, cfg->mint_url) == 0); 271 if (strstr(mint_url, cfg->accepted_mints[i]) != NULL) return true;
272 if (strcmp(mint_url, cfg->accepted_mints[i]) == 0) return true;
273 }
274 return false;
272} 275}