MCPcopy Create free account
hub / github.com/chain/txvm / setHeight

Method setHeight

protocol/protocol.go:212–226  ·  view source on GitHub ↗
(h uint64)

Source from the content-addressed store, hash-verified

210}
211
212func (c *Chain) setHeight(h uint64) {
213 // We update c.state.height from multiple places:
214 // setState and here, called by the Postgres LISTEN
215 // goroutine. setHeight must ignore heights less than
216 // the current height.
217
218 c.state.cond.L.Lock()
219 defer c.state.cond.L.Unlock()
220
221 if h <= c.state.height {
222 return
223 }
224 c.state.height = h
225 c.state.cond.Broadcast()
226}
227
228// BlockWaiter returns a channel that
229// waits for the block at the given height.

Callers 2

NewChainFunction · 0.95
TestNoTimeTravelFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestNoTimeTravelFunction · 0.76