From 9330b01c28aebc865a3c0a51df8730196cb4152e Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 23 May 2026 04:50:26 +0530 Subject: Phase 6a-6d: Consolidate and clean up 6a: Delete dead standalone tollgate_core/ (12 files, never compiled) 6b: Rewrite dns_server.c as thin shim to component's tollgate_core_dns - Fix component DNS to bind to AP IP instead of INADDR_ANY 6c: Rewrite stratum_proxy.c as thin shim with struct cast to component types 6d: Move sandbox logic into component's tollgate_core_firewall - Add tollgate_core_fw_set_sandbox_ports/set_sandbox_mint_access - Add is_sandbox_allowed() to component's ip4_canforward_filter - Clean main/firewall.c to delegate filter to component - Remove redundant DNS auth double-calls from main firewall Add ROADMAP.md with full extraction plan and checklists All 21 unit tests pass. ESP-IDF build passes. --- tollgate_core/src/tollgate_mining.h | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 tollgate_core/src/tollgate_mining.h (limited to 'tollgate_core/src/tollgate_mining.h') diff --git a/tollgate_core/src/tollgate_mining.h b/tollgate_core/src/tollgate_mining.h deleted file mode 100644 index 39681a5..0000000 --- a/tollgate_core/src/tollgate_mining.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef TOLLGATE_CORE_MINING_H -#define TOLLGATE_CORE_MINING_H - -#include -#include - -#define TG_MINING_SHARE_WINDOW_S 30 -#define TG_MINING_BLOCK_SUBSIDY_SATS 312500000ULL -#define TG_MINING_BLOCKS_PER_DAY 144ULL -#define TG_MINING_MAX_CLIENTS 10 - -typedef struct { - uint32_t ip; - uint64_t shares_accepted; - uint64_t shares_rejected; - int64_t first_share_time_ms; - int64_t last_share_time_ms; - double hashrate_ghs; -} tg_mining_client_stats_t; - -uint64_t tg_mining_nbits_to_difficulty(uint32_t nbits); -double tg_mining_calculate_hashprice(uint32_t nbits); -double tg_mining_calculate_hashprice_override(uint64_t sats_per_ghs_day); -int tg_mining_validate_share(const uint8_t *header80, uint32_t nonce, const uint8_t *target, int target_len); -uint64_t tg_mining_shares_to_allotment_ms(double hashrate_ghs, double hashprice, int price, int step_ms); -uint64_t tg_mining_shares_to_allotment_bytes(double hashrate_ghs, double hashprice, int price, int step_bytes); -tg_mining_client_stats_t *tg_mining_get_or_create_client(uint32_t client_ip); -void tg_mining_update_hashrate(uint32_t client_ip, bool accepted); -const tg_mining_client_stats_t *tg_mining_get_client_stats(uint32_t client_ip); -double tg_mining_get_current_hashprice(void); -void tg_mining_set_current_nbits(uint32_t nbits); -void tg_mining_init(void); - -#endif -- cgit v1.2.3