mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
rpc: add app_hash to /status
This commit is contained in:
@ -2,35 +2,10 @@ package core
|
||||
|
||||
import (
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// TODO Move to status.go or node.go
|
||||
func Status() (*ctypes.ResultStatus, error) {
|
||||
latestHeight := blockStore.Height()
|
||||
var (
|
||||
latestBlockMeta *types.BlockMeta
|
||||
latestBlockHash []byte
|
||||
latestBlockTime int64
|
||||
)
|
||||
if latestHeight != 0 {
|
||||
latestBlockMeta = blockStore.LoadBlockMeta(latestHeight)
|
||||
latestBlockHash = latestBlockMeta.Hash
|
||||
latestBlockTime = latestBlockMeta.Header.Time.UnixNano()
|
||||
}
|
||||
|
||||
return &ctypes.ResultStatus{
|
||||
NodeInfo: p2pSwitch.NodeInfo(),
|
||||
PubKey: privValidator.PubKey,
|
||||
LatestBlockHash: latestBlockHash,
|
||||
LatestBlockHeight: latestHeight,
|
||||
LatestBlockTime: latestBlockTime}, nil
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
func NetInfo() (*ctypes.ResultNetInfo, error) {
|
||||
listening := p2pSwitch.IsListening()
|
||||
listeners := []string{}
|
||||
|
Reference in New Issue
Block a user