diff options
| author | Your Name <you@example.com> | 2026-05-19 04:13:11 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 04:13:11 +0530 |
| commit | beb73a2eeacf7dbe5e292ce6e26a95a933808267 (patch) | |
| tree | 3a9b711e1475c09ed544b96358587df3e5362555 /main/session.h | |
| parent | c75230e551a778408b2e370b208aff76b74c6560 (diff) | |
feat(mining): integrate mining subsystem into existing modules
- CMakeLists.txt: add 6 mining sources + tcp_transport dependency
- config.h/c: mining_payout_mode_t enum, mining config fields, JSON parsing
- tollgate_main.c: mining init in start_services(), stratum_client_tick in main loop
- tollgate_api.c: GET /mining/job, POST /mining/share, GET /mining/stats endpoints
- session.h/c: payment_method_t enum (CASHU/MINING/BYTES)
- firewall.h/c: sandbox allowlist for mining port + mint URLs
- tollgate_client.h/c: TG_CLIENT_MINING state, mining discovery tag parsing
- captive_portal.c: tabbed UI with Cashu/Mine tabs, live hashrate polling
Diffstat (limited to 'main/session.h')
| -rw-r--r-- | main/session.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/session.h b/main/session.h index 36fe722..d3a61bb 100644 --- a/main/session.h +++ b/main/session.h | |||
| @@ -8,6 +8,12 @@ | |||
| 8 | #define SESSION_MAX_CLIENTS 10 | 8 | #define SESSION_MAX_CLIENTS 10 |
| 9 | #define SESSION_MAX_MAC_LEN 18 | 9 | #define SESSION_MAX_MAC_LEN 18 |
| 10 | 10 | ||
| 11 | typedef enum { | ||
| 12 | PAYMENT_METHOD_CASHU, | ||
| 13 | PAYMENT_METHOD_MINING, | ||
| 14 | PAYMENT_METHOD_BYTES | ||
| 15 | } payment_method_t; | ||
| 16 | |||
| 11 | typedef struct { | 17 | typedef struct { |
| 12 | uint32_t client_ip; | 18 | uint32_t client_ip; |
| 13 | char mac[SESSION_MAX_MAC_LEN]; | 19 | char mac[SESSION_MAX_MAC_LEN]; |
| @@ -15,6 +21,7 @@ typedef struct { | |||
| 15 | int64_t start_time_ms; | 21 | int64_t start_time_ms; |
| 16 | uint64_t allotment_bytes; | 22 | uint64_t allotment_bytes; |
| 17 | uint64_t bytes_consumed; | 23 | uint64_t bytes_consumed; |
| 24 | payment_method_t payment_method; | ||
| 18 | bool active; | 25 | bool active; |
| 19 | } session_t; | 26 | } session_t; |
| 20 | 27 | ||