mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-01 23:51:21 +00:00
add validator address to /status
This commit is contained in:
parent
a2d77cbe4e
commit
47e4d64973
@ -79,6 +79,11 @@ func Status() (*ctypes.ResultStatus, error) {
|
|||||||
|
|
||||||
latestBlockTime := time.Unix(0, latestBlockTimeNano)
|
latestBlockTime := time.Unix(0, latestBlockTimeNano)
|
||||||
|
|
||||||
|
var votingPower int64
|
||||||
|
if val := validatorAtHeight(latestHeight); val != nil {
|
||||||
|
votingPower = val.VotingPower
|
||||||
|
}
|
||||||
|
|
||||||
result := &ctypes.ResultStatus{
|
result := &ctypes.ResultStatus{
|
||||||
NodeInfo: p2pSwitch.NodeInfo(),
|
NodeInfo: p2pSwitch.NodeInfo(),
|
||||||
SyncInfo: ctypes.SyncInfo{
|
SyncInfo: ctypes.SyncInfo{
|
||||||
@ -88,12 +93,11 @@ func Status() (*ctypes.ResultStatus, error) {
|
|||||||
LatestBlockTime: latestBlockTime,
|
LatestBlockTime: latestBlockTime,
|
||||||
Syncing: consensusReactor.FastSync(),
|
Syncing: consensusReactor.FastSync(),
|
||||||
},
|
},
|
||||||
ValidatorInfo: ctypes.ValidatorInfo{PubKey: pubKey},
|
ValidatorInfo: ctypes.ValidatorInfo{
|
||||||
}
|
Address: pubKey.Address(),
|
||||||
|
PubKey: pubKey,
|
||||||
// add ValidatorStatus if node is a validator
|
VotingPower: votingPower,
|
||||||
if val := validatorAtHeight(latestHeight); val != nil {
|
},
|
||||||
result.ValidatorInfo.VotingPower = val.VotingPower
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
@ -63,6 +63,7 @@ type SyncInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ValidatorInfo struct {
|
type ValidatorInfo struct {
|
||||||
|
Address cmn.HexBytes `json:"address"`
|
||||||
PubKey crypto.PubKey `json:"pub_key"`
|
PubKey crypto.PubKey `json:"pub_key"`
|
||||||
VotingPower int64 `json:"voting_power"`
|
VotingPower int64 `json:"voting_power"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user