core: drop GetStandBy* methods
They're misleading now that we have variable number of committee members/validators. The standby list can be seen in the configuration and the appropriate numbers can be received from it also.
This commit is contained in:
parent
e621f746a7
commit
cda1c75db3
11 changed files with 69 additions and 72 deletions
|
@ -49,25 +49,13 @@ func createGenesisBlock(cfg config.ProtocolConfiguration) (*block.Block, error)
|
|||
}
|
||||
|
||||
func validatorsFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey, error) {
|
||||
vs, err := committeeFromConfig(cfg)
|
||||
vs, err := keys.NewPublicKeysFromStrings(cfg.StandbyCommittee)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return vs[:cfg.GetNumOfCNs(0)], nil
|
||||
}
|
||||
|
||||
func committeeFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey, error) {
|
||||
validators := make([]*keys.PublicKey, len(cfg.StandbyCommittee))
|
||||
for i := range validators {
|
||||
pubKey, err := keys.NewPublicKeyFromString(cfg.StandbyCommittee[i])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
validators[i] = pubKey
|
||||
}
|
||||
return validators, nil
|
||||
}
|
||||
|
||||
func getNextConsensusAddress(validators []*keys.PublicKey) (val util.Uint160, err error) {
|
||||
raw, err := smartcontract.CreateDefaultMultiSigRedeemScript(validators)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue