upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/mcp_handler.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-23 05:32:22 +0530
committerYour Name <you@example.com>2026-05-23 05:32:22 +0530
commit5140a30be35aaf3574efce9193549f18524ce46e (patch)
treec1146fc161fe787ccabd04558219b7591e207b61 /main/mcp_handler.c
parentfb8558cbf964fae5a840f8f948b89a0d42045802 (diff)
Phase 7: eliminate shims - consumer files use component headers directly
- Deleted standalone shims: session.c/h, cashu.c/h, mining_payment.c/h, firewall.c/h - Updated captive_portal.c, tollgate_api.c, tollgate_main.c, mcp_handler.c, cvm_server.c, sw_miner.c, stratum_client.c to include component headers - Moved tollgate_ip4_canforward_filter() lwIP hook into tollgate_main.c - Fixed all unit tests to use component API (test_cashu, test_session, test_mining_payment, test_stratum_proxy, test_session_payment_method, test_firewall_sandbox, test_mcp_handler) - Removed deleted source files from Makefile targets - All 21 unit tests pass, ESP-IDF build passes
Diffstat (limited to 'main/mcp_handler.c')
-rw-r--r--main/mcp_handler.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/main/mcp_handler.c b/main/mcp_handler.c
index 93bfba9..5f5d494 100644
--- a/main/mcp_handler.c
+++ b/main/mcp_handler.c
@@ -1,7 +1,8 @@
1#include "mcp_handler.h" 1#include "mcp_handler.h"
2#include "config.h" 2#include "config.h"
3#include "nucula_wallet.h" 3#include "nucula_wallet.h"
4#include "session.h" 4#include "tollgate_core_session.h"
5#include "tollgate_core.h"
5#include "cJSON.h" 6#include "cJSON.h"
6#include "lwip/ip4_addr.h" 7#include "lwip/ip4_addr.h"
7#include <string.h> 8#include <string.h>
@@ -157,12 +158,10 @@ mcp_response_t mcp_handle_wallet_send(const char *params_json)
157mcp_response_t mcp_handle_get_sessions(void) 158mcp_response_t mcp_handle_get_sessions(void)
158{ 159{
159 mcp_response_t resp = {0}; 160 mcp_response_t resp = {0};
160 extern session_t *cvm_get_sessions_array(void);
161 extern int cvm_get_sessions_count(void);
162 161
163 cJSON *arr = cJSON_CreateArray(); 162 cJSON *arr = cJSON_CreateArray();
164 int count = cvm_get_sessions_count(); 163 int count = tollgate_core_session_get_array_size();
165 session_t *sessions = cvm_get_sessions_array(); 164 tg_session_t *sessions = tollgate_core_session_get_array();
166 165
167 if (sessions && count > 0) { 166 if (sessions && count > 0) {
168 for (int i = 0; i < count; i++) { 167 for (int i = 0; i < count; i++) {