diff --git a/pkg/mining/simulated_miner.go b/pkg/mining/simulated_miner.go index 20a819b..92c17c8 100644 --- a/pkg/mining/simulated_miner.go +++ b/pkg/mining/simulated_miner.go @@ -88,17 +88,17 @@ func (m *SimulatedMiner) GetType() string { return m.MinerType } -// Install is a no-op for simulated miners. +// if err := miner.Install(); err != nil { /* never errors */ } func (m *SimulatedMiner) Install() error { return nil } -// Uninstall is a no-op for simulated miners. +// if err := miner.Uninstall(); err != nil { /* never errors */ } func (m *SimulatedMiner) Uninstall() error { return nil } -// Start begins the simulated mining process. +// if err := miner.Start(config); err != nil { /* already running */ } func (m *SimulatedMiner) Start(config *Config) error { m.mu.Lock() if m.Running { @@ -142,7 +142,6 @@ func (m *SimulatedMiner) Stop() error { return nil } -// runSimulation runs the background simulation loop. func (m *SimulatedMiner) runSimulation() { ticker := time.NewTicker(HighResolutionInterval) defer ticker.Stop() @@ -164,7 +163,6 @@ func (m *SimulatedMiner) runSimulation() { } } -// updateHashrate generates a new hashrate value with realistic variation. func (m *SimulatedMiner) updateHashrate() { m.mu.Lock() defer m.mu.Unlock() @@ -244,7 +242,6 @@ func (m *SimulatedMiner) updateHashrate() { } } -// simulateShare simulates finding a share. func (m *SimulatedMiner) simulateShare() { m.mu.Lock() defer m.mu.Unlock() @@ -353,7 +350,7 @@ func (m *SimulatedMiner) AddHashratePoint(point HashratePoint) { m.HashrateHistory = append(m.HashrateHistory, point) } -// ReduceHashrateHistory reduces the history (called by manager). +// manager.ReduceHashrateHistory(miner, time.Now()) func (m *SimulatedMiner) ReduceHashrateHistory(now time.Time) { m.mu.Lock() defer m.mu.Unlock() @@ -406,7 +403,7 @@ func (m *SimulatedMiner) GetLogs() []string { return result } -// WriteStdin simulates stdin input. +// if err := miner.WriteStdin("h"); err != nil { /* not running */ } func (m *SimulatedMiner) WriteStdin(input string) error { m.mu.Lock() defer m.mu.Unlock()