diff --git a/cmix/nodes/interfaces.go b/cmix/nodes/interfaces.go index 5d08e6db9a6c97712621ed02ced970e8344e1f00..ddce4b8f21c98f4ed6824e56a6d755be63ee6f82 100644 --- a/cmix/nodes/interfaces.go +++ b/cmix/nodes/interfaces.go @@ -27,6 +27,10 @@ type Registrar interface { // to register with nodes. StartProcesses(numParallel uint) stoppable.Stoppable + // IncreaseParallelNodeRegistration increases the number of parallel node + // registrations by num + IncreaseParallelNodeRegistration(num int) func() (stoppable.Stoppable, error) + // GetNodeKeys returns a MixCypher for the topology and a list of nodes it did // not have a key for. If there are missing keys, then returns nil. GetNodeKeys(topology *connect.Circuit) (MixCypher, error) diff --git a/cmix/nodes/registrar.go b/cmix/nodes/registrar.go index fedd7ddd338f2afe56139eaa8955f2e04ccd4d4d..0c942b8de091ab1d64b2eb2cc0d67b73c19d0194 100644 --- a/cmix/nodes/registrar.go +++ b/cmix/nodes/registrar.go @@ -108,11 +108,11 @@ func (r *registrar) StartProcesses(numParallel uint) stoppable.Stoppable { // IncreaseParallelNodeRegistration increases the number of parallel node // registrations by num -func (r *registrar) IncreaseParallelNodeRegistration(numParallel uint) func() (stoppable.Stoppable, error) { +func (r *registrar) IncreaseParallelNodeRegistration(numParallel int) func() (stoppable.Stoppable, error) { return func() (stoppable.Stoppable, error) { multi := stoppable.NewMulti("NodeRegistrationsIncrease") - for i := uint(0); i < numParallel; i++ { + for i := uint(0); i < uint(numParallel); i++ { stop := stoppable.NewSingle("NodeRegistration Increase" + strconv.Itoa(int(i))) go registerNodes(r, r.session, stop, &r.inProgress, &r.attempts)