Skip to content

Commit

Permalink
Fixed tn.SetConfig bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoAndreSa committed Mar 12, 2020
1 parent 7f37465 commit 6340084
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions services/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@ func (s *Service) HandleQueryBroadcastFinished(recq *QueryBroadcastFinished) (ne

// NewProtocol creates a protocol instance executed by all nodes
func (s *Service) NewProtocol(tn *onet.TreeNodeInstance, conf *onet.GenericConfig) (onet.ProtocolInstance, error) {
if err := tn.SetConfig(conf); err != nil {
return nil, xerrors.Errorf("couldn't set config: %+v", err)
}

var pi onet.ProtocolInstance
target := SurveyID(string(conf.Data))
survey, err := s.getSurvey(SurveyID(conf.Data))
Expand Down Expand Up @@ -595,6 +591,9 @@ func (s *Service) StartProtocol(name string, targetSurvey SurveyID) (onet.Protoc

conf := onet.GenericConfig{Data: []byte(string(targetSurvey))}

if err := tn.SetConfig(&conf); err != nil {
return nil, xerrors.Errorf("couldn't set config: %+v", err)
}
pi, err := s.NewProtocol(tn, &conf)
if err != nil {
return nil, fmt.Errorf("error running "+name+" : %v", err)
Expand Down

0 comments on commit 6340084

Please sign in to comment.