MCPcopy Create free account
hub / github.com/DNAProject/DNA / getNextValidatorPIDs

Method getNextValidatorPIDs

txnpool/proc/txnpool_server.go:441–457  ·  view source on GitHub ↗

getNextValidatorPIDs returns the next pids to verify the transaction using roundRobin LB.

()

Source from the content-addressed store, hash-verified

439// getNextValidatorPIDs returns the next pids to verify the transaction using
440// roundRobin LB.
441func (s *TXPoolServer) getNextValidatorPIDs() []*actor.PID {
442 s.validators.Lock()
443 defer s.validators.Unlock()
444
445 if len(s.validators.entries) == 0 {
446 return nil
447 }
448
449 ret := make([]*actor.PID, 0, len(s.validators.entries))
450 for k, v := range s.validators.entries {
451 lastIdx := s.validators.state.state[k]
452 next := (lastIdx + 1) % len(v)
453 s.validators.state.state[k] = next
454 ret = append(ret, v[next].Sender)
455 }
456 return ret
457}
458
459// getNextValidatorPID returns the next pid with the verify type using roundRobin LB
460func (s *TXPoolServer) getNextValidatorPID(key types.VerifyType) *actor.PID {

Callers 2

TestValidatorFunction · 0.95
sendReq2ValidatorMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestValidatorFunction · 0.76