Add logs to lite/*; Fix rpc status to return consensus height, not blockstore height

This commit is contained in:
Jae Kwon
2018-06-26 16:52:38 -07:00
parent 7f4498f8b1
commit 37ef5485b4
15 changed files with 174 additions and 68 deletions

View File

@ -196,6 +196,15 @@ func (cs *ConsensusState) GetState() sm.State {
return cs.state.Copy()
}
// GetLastHeight returns the last height committed.
// If there were no blocks, returns 0.
func (cs *ConsensusState) GetLastHeight() int64 {
cs.mtx.Lock()
defer cs.mtx.Unlock()
return cs.RoundState.Height - 1
}
// GetRoundState returns a shallow copy of the internal consensus state.
func (cs *ConsensusState) GetRoundState() *cstypes.RoundState {
cs.mtx.Lock()