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:
@@ -49,3 +49,13 @@ func writeAgentID(installDir, id string) error {
|
||||
path := filepath.Join(installDir, agentIDFile)
|
||||
return os.WriteFile(path, []byte(id+"\n"), 0600)
|
||||
}
|
||||
|
||||
// PersistAgentID writes the server-confirmed agent ID to disk, overwriting any
|
||||
// locally-generated one. This ensures restarts always reconnect as the same agent.
|
||||
func PersistAgentID(installDir, id string) error {
|
||||
if id == "" {
|
||||
return nil
|
||||
}
|
||||
_ = os.MkdirAll(installDir, 0755)
|
||||
return writeAgentID(installDir, id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user