finishSyncing() is called when the syncing loop is completed for a specific chainId
()
| 723 | |
| 724 | // finishSyncing() is called when the syncing loop is completed for a specific chainId |
| 725 | func (c *Controller) finishSyncing() { |
| 726 | c.log.Debug("Finish syncing") |
| 727 | //defer lib.TimeTrack(c.log, time.Now()) |
| 728 | // lock the controller for thread safety |
| 729 | c.Lock() |
| 730 | // when function completes, unlock |
| 731 | defer c.Unlock() |
| 732 | // set the startup block metric (block height when first sync completed) |
| 733 | c.Metrics.SetStartupBlock(c.FSM.Height()) |
| 734 | // signal a reset of bft for the chain |
| 735 | c.Consensus.ResetBFT <- bft.ResetBFT{StartTime: c.LoadLastCommitTime(c.FSM.Height())} |
| 736 | // set syncing to false |
| 737 | c.isSyncing.Store(false) |
| 738 | // enable listening for a block |
| 739 | go c.ListenForBlock() |
| 740 | } |
| 741 | |
| 742 | // ConsensusSummary() for the RPC - returns the summary json object of the bft for a specific chainID |
| 743 | func (c *Controller) ConsensusSummary() ([]byte, lib.ErrorI) { |
no test coverage detected