getNextValidatorPIDs returns the next pids to verify the transaction using roundRobin LB.
()
| 439 | // getNextValidatorPIDs returns the next pids to verify the transaction using |
| 440 | // roundRobin LB. |
| 441 | func (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 |
| 460 | func (s *TXPoolServer) getNextValidatorPID(key types.VerifyType) *actor.PID { |
no outgoing calls