MCPcopy Create free account
hub / github.com/chain/Core / pollGeneratorHeight

Function pollGeneratorHeight

core/fetch/fetch.go:130–144  ·  view source on GitHub ↗
(ctx context.Context, peer *rpc.Client)

Source from the content-addressed store, hash-verified

128}
129
130func pollGeneratorHeight(ctx context.Context, peer *rpc.Client) {
131 updateGeneratorHeight(ctx, peer)
132
133 ticker := time.NewTicker(heightPollingPeriod)
134 for {
135 select {
136 case <-ctx.Done():
137 log.Printf(ctx, "Deposed, fetchGeneratorHeight exiting")
138 ticker.Stop()
139 return
140 case <-ticker.C:
141 updateGeneratorHeight(ctx, peer)
142 }
143 }
144}
145
146func updateGeneratorHeight(ctx context.Context, peer *rpc.Client) {
147 gh, err := getHeight(ctx, peer)

Callers 1

InitFunction · 0.85

Calls 1

updateGeneratorHeightFunction · 0.85

Tested by

no test coverage detected