Stop stops the main process of the sql-chain.
()
| 864 | |
| 865 | // Stop stops the main process of the sql-chain. |
| 866 | func (c *Chain) Stop() (err error) { |
| 867 | // Stop main process |
| 868 | le := c.logEntry() |
| 869 | le.Debug("stopping chain") |
| 870 | c.rt.stop(c.databaseID) |
| 871 | le.Debug("chain service and workers stopped") |
| 872 | // Close state |
| 873 | var ierr error |
| 874 | if ierr = c.st.Close(false); ierr != nil && err == nil { |
| 875 | err = ierr |
| 876 | } |
| 877 | le.WithError(ierr).Debug("chain state storage closed") |
| 878 | return |
| 879 | } |
| 880 | |
| 881 | // FetchBlock fetches the block at specified height from local cache. |
| 882 | func (c *Chain) FetchBlock(height int32) (b *types.Block, err error) { |