send zero event to miner.powQuitChan fixes miner hanging
This commit is contained in:
		@@ -133,6 +133,9 @@ func (miner *Miner) listener() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (miner *Miner) Stop() {
 | 
					func (miner *Miner) Stop() {
 | 
				
			||||||
	logger.Infoln("Stopping...")
 | 
						logger.Infoln("Stopping...")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						miner.powQuitChan <- ethreact.Event{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	status := make(chan error)
 | 
						status := make(chan error)
 | 
				
			||||||
	miner.quitChan <- status
 | 
						miner.quitChan <- status
 | 
				
			||||||
	<-status
 | 
						<-status
 | 
				
			||||||
@@ -143,9 +146,6 @@ func (miner *Miner) Stop() {
 | 
				
			|||||||
	reactor.Unsubscribe("newBlock", miner.reactChan)
 | 
						reactor.Unsubscribe("newBlock", miner.reactChan)
 | 
				
			||||||
	reactor.Unsubscribe("newTx:pre", miner.reactChan)
 | 
						reactor.Unsubscribe("newTx:pre", miner.reactChan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	close(miner.powQuitChan)
 | 
					 | 
				
			||||||
	close(miner.quitChan)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	reactor.Post("miner:stop", miner)
 | 
						reactor.Post("miner:stop", miner)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user