MCPcopy
hub / github.com/canopy-network/canopy / finishSyncing

Method finishSyncing

controller/consensus.go:725–740  ·  view source on GitHub ↗

finishSyncing() is called when the syncing loop is completed for a specific chainId

()

Source from the content-addressed store, hash-verified

723
724// finishSyncing() is called when the syncing loop is completed for a specific chainId
725func (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
743func (c *Controller) ConsensusSummary() ([]byte, lib.ErrorI) {

Callers 1

SyncMethod · 0.95

Calls 8

LockMethod · 0.95
UnlockMethod · 0.95
LoadLastCommitTimeMethod · 0.95
ListenForBlockMethod · 0.95
SetStartupBlockMethod · 0.80
StoreMethod · 0.80
DebugMethod · 0.65
HeightMethod · 0.45

Tested by

no test coverage detected