MCPcopy Index your code
hub / github.com/chain/Core / queueSnapshot

Method queueSnapshot

protocol/block.go:193–204  ·  view source on GitHub ↗
(ctx context.Context, height uint64, timestamp time.Time, s *state.Snapshot)

Source from the content-addressed store, hash-verified

191}
192
193func (c *Chain) queueSnapshot(ctx context.Context, height uint64, timestamp time.Time, s *state.Snapshot) {
194 // Non-blockingly queue the snapshot for storage.
195 ps := pendingSnapshot{height: height, snapshot: s}
196 select {
197 case c.pendingSnapshots <- ps:
198 c.lastQueuedSnapshot = timestamp
199 default:
200 // Skip it; saving snapshots is taking longer than the snapshotting period.
201 log.Printf(ctx, "snapshot storage is taking too long; last queued at %s",
202 c.lastQueuedSnapshot)
203 }
204}
205
206func (c *Chain) setHeight(h uint64) {
207 // We call setHeight from two places independently:

Callers 1

CommitAppliedBlockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected