(h uint64)
| 210 | } |
| 211 | |
| 212 | func (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. |
no outgoing calls