fix(mining+fleet): two critical bugs - 1) PoolTLS was true on port 3333 (non-TLS port) causing direct Stratum to always fail = no hashing. Fixed to false. 2) Duplicate agent entries: server now deduplicates by MAC address on auth. Agent now persists server-confirmed ID back to agent.id so reinstalls reconnect as same agent. USB repacked.

This commit is contained in:
AetherForge
2026-06-03 10:54:47 -07:00
parent f12cbe72d4
commit 2f85f2066d
7 changed files with 40 additions and 2 deletions

View File

@@ -484,10 +484,20 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
return
}
agentID = auth.AgentID
agentID = auth.AgentID
if agentID == "" {
// Try to match an existing agent by MAC address so a re-installed
// agent reuses its DB record instead of creating a ghost entry.
if auth.MacAddress != "" {
if existingID, err := h.db.FindAgentByMAC(auth.MacAddress); err == nil && existingID != "" {
agentID = existingID
log.Printf("[WS] Matched agent by MAC %s → reusing id=%s", auth.MacAddress, agentID)
}
}
if agentID == "" {
agentID = uuid.New().String()
}
}
displayName := agentDisplayName(auth.WorkerName, auth.Worker, auth.Hostname, agentID)