Merge pull request #944 from nghiangovan/dev-upgrade

add-epoch-number-for-XDPoS_getMasternodesByNumber
This commit is contained in:
Wanwiset Peerapatanapokin 2025-05-07 15:28:59 +04:00 committed by GitHub
commit a9199d4140
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,6 +65,7 @@ type SignerTypes struct {
}
type MasternodesStatus struct {
Epoch uint64
Number uint64
Round types.Round
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)
penalties := api.XDPoS.EngineV2.GetPenalties(api.chain, header)
standbynodes := api.XDPoS.EngineV2.GetStandbynodes(api.chain, header)
info := MasternodesStatus{
Epoch: epochNum,
Number: header.Number.Uint64(),
Round: round,
MasternodesLen: len(masterNodes),