Skip to content

Clean shutdown of miner

Christopher Schinnerl requested to merge mnsl:minershutdown into master

Created by: mnsl

Adds tg *siasync.ThreadGroup field to the Miner type; m.tg.Stop() is called at the start of m.Close(), automatically unsubscribing the miner from its consensus set and transaction pool and blocking until the m.threadedMine() goroutine is done.

To unsubscribe the miner from the transaction pool, I've added an exported Unsubscribe method to TransactionPool (akin to the ConsensusSet Unsubscribe method).

Merge request reports