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

Method SetStartupBlock

lib/metrics.go:734–744  ·  view source on GitHub ↗

SetStartupBlock() sets the block height when the node first completed syncing after startup

(blockHeight uint64)

Source from the content-addressed store, hash-verified

732
733// SetStartupBlock() sets the block height when the node first completed syncing after startup
734func (m *Metrics) SetStartupBlock(blockHeight uint64) {
735 // exit if empty
736 if m == nil {
737 return
738 }
739 // only set the startup block metric once per node run
740 if !m.startupBlockSet {
741 m.StartupBlock.Set(float64(blockHeight))
742 m.startupBlockSet = true
743 }
744}
745
746func (m *Metrics) UpdateValidatorCount(count int) {
747 // exit if empty

Callers 1

finishSyncingMethod · 0.80

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected