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

@ -3,8 +3,8 @@ package core
import (
"time"
crypto "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/consensus"
crypto "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/proxy"
sm "github.com/tendermint/tendermint/state"
@ -28,6 +28,7 @@ var subscribeTimeout = 5 * time.Second
type Consensus interface {
GetState() sm.State
GetValidators() (int64, []*types.Validator)
GetLastHeight() int64
GetRoundStateJSON() ([]byte, error)
GetRoundStateSimpleJSON() ([]byte, error)
}

View File

@ -64,7 +64,12 @@ import (
//}
// ```
func Status() (*ctypes.ResultStatus, error) {
latestHeight := blockStore.Height()
var latestHeight int64 = -1
if consensusReactor.FastSync() {
latestHeight = blockStore.Height()
} else {
latestHeight = consensusState.GetLastHeight()
}
var (
latestBlockMeta *types.BlockMeta
latestBlockHash cmn.HexBytes