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:
Diffstat (limited to 'main/cashu.c')
-rw-r--r--main/cashu.c10
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}