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

Method checkpointFromFile

controller/controller.go:441–451  ·  view source on GitHub ↗

checkpointFromFile returns a cached checkpoint for a given chain and height, or nil if not found.

(height, chainId uint64)

Source from the content-addressed store, hash-verified

439
440// checkpointFromFile returns a cached checkpoint for a given chain and height, or nil if not found.
441func (c *Controller) checkpointFromFile(height, chainId uint64) lib.HexBytes {
442 if c.checkpoints == nil {
443 return nil
444 }
445 if chainCheckpoints, ok := c.checkpoints[chainId]; ok {
446 if checkpoint, ok := chainCheckpoints[height]; ok {
447 return checkpoint
448 }
449 }
450 return nil
451}
452
453// convenience aliases that reference the library package
454const (

Callers 1

HandlePeerBlockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected