State returns the most recent state available. It will not be current unless the current process is the leader. Callers should examine the returned state header's height if they need to verify the current state.
()
| 187 | // unless the current process is the leader. Callers should examine the |
| 188 | // returned state header's height if they need to verify the current state. |
| 189 | func (c *Chain) State() *state.Snapshot { |
| 190 | c.state.cond.L.Lock() |
| 191 | defer c.state.cond.L.Unlock() |
| 192 | return c.state.snapshot |
| 193 | } |
| 194 | |
| 195 | func (c *Chain) setState(s *state.Snapshot) { |
| 196 | c.state.cond.L.Lock() |
no outgoing calls