consensus: log error if GetValidators() failed
This commit is contained in:
parent
de5215a564
commit
21ef2638c0
1 changed files with 10 additions and 3 deletions
|
@ -476,16 +476,23 @@ func (s *service) getVerifiedTx(count int) []block.Transaction {
|
|||
}
|
||||
|
||||
func (s *service) getValidators(txx ...block.Transaction) []crypto.PublicKey {
|
||||
var pKeys []*keys.PublicKey
|
||||
var (
|
||||
pKeys []*keys.PublicKey
|
||||
err error
|
||||
)
|
||||
if len(txx) == 0 {
|
||||
pKeys, _ = s.Chain.GetValidators()
|
||||
pKeys, err = s.Chain.GetValidators()
|
||||
} else {
|
||||
ntxx := make([]*transaction.Transaction, len(txx))
|
||||
for i := range ntxx {
|
||||
ntxx[i] = txx[i].(*transaction.Transaction)
|
||||
}
|
||||
|
||||
pKeys, _ = s.Chain.GetValidators(ntxx...)
|
||||
pKeys, err = s.Chain.GetValidators(ntxx...)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
s.log.Error("error while trying to get validators", zap.Error(err))
|
||||
}
|
||||
|
||||
pubs := make([]crypto.PublicKey, len(pKeys))
|
||||
|
|
Loading…
Reference in a new issue