Stop implements node.Service, terminating all internal goroutines used by the cpchain protocol.
()
| 521 | // Stop implements node.Service, terminating all internal goroutines used by the |
| 522 | // cpchain protocol. |
| 523 | func (s *CpchainService) Stop() error { |
| 524 | s.bloomIndexer.Close() |
| 525 | s.blockchain.Stop() |
| 526 | s.protocolManager.Stop() |
| 527 | if s.lesServer != nil { |
| 528 | s.lesServer.Stop() |
| 529 | } |
| 530 | s.txPool.Stop() |
| 531 | s.miner.Stop() |
| 532 | s.eventMux.Stop() |
| 533 | |
| 534 | s.chainDb.Close() |
| 535 | close(s.shutdownChan) |
| 536 | |
| 537 | return nil |
| 538 | } |