mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-11 07:24:27 +00:00
Merge pull request #944 from nghiangovan/dev-upgrade
add-epoch-number-for-XDPoS_getMasternodesByNumber
This commit is contained in:
commit
a9199d4140
1 changed files with 3 additions and 0 deletions
|
|
@ -65,6 +65,7 @@ type SignerTypes struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type MasternodesStatus struct {
|
type MasternodesStatus struct {
|
||||||
|
Epoch uint64
|
||||||
Number uint64
|
Number uint64
|
||||||
Round types.Round
|
Round types.Round
|
||||||
MasternodesLen int
|
MasternodesLen int
|
||||||
|
|
@ -147,11 +148,13 @@ func (api *API) GetMasternodesByNumber(number *rpc.BlockNumber) MasternodesStatu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
epochNum := api.XDPoS.config.V2.SwitchEpoch + uint64(round)/api.XDPoS.config.Epoch
|
||||||
masterNodes := api.XDPoS.EngineV2.GetMasternodes(api.chain, header)
|
masterNodes := api.XDPoS.EngineV2.GetMasternodes(api.chain, header)
|
||||||
penalties := api.XDPoS.EngineV2.GetPenalties(api.chain, header)
|
penalties := api.XDPoS.EngineV2.GetPenalties(api.chain, header)
|
||||||
standbynodes := api.XDPoS.EngineV2.GetStandbynodes(api.chain, header)
|
standbynodes := api.XDPoS.EngineV2.GetStandbynodes(api.chain, header)
|
||||||
|
|
||||||
info := MasternodesStatus{
|
info := MasternodesStatus{
|
||||||
|
Epoch: epochNum,
|
||||||
Number: header.Number.Uint64(),
|
Number: header.Number.Uint64(),
|
||||||
Round: round,
|
Round: round,
|
||||||
MasternodesLen: len(masterNodes),
|
MasternodesLen: len(masterNodes),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue