Skip to content

Commit

Permalink
deadlock removed from kirk's comments (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkolasg committed Aug 26, 2020
1 parent 763e9a2 commit 94a2942
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/drand_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ func (d *Drand) setupAutomaticDKG(_ context.Context, in *drand.InitDKGPacket) (*
receiver, err := newSetupReceiver(d.log, d.opts.clock, d.privGateway.ProtocolClient, in.GetInfo())
if err != nil {
d.log.Error("setup", "fail", "err", err)
d.state.Unlock()
return nil, err
}
d.receiver = receiver
Expand Down Expand Up @@ -376,6 +377,7 @@ func (d *Drand) setupAutomaticResharing(_ context.Context, oldGroup *key.Group,
if d.receiver != nil {
if !in.GetInfo().GetForce() {
d.log.Info("reshare_setup", "already in progress", "restart", "NOT AUTHORIZED")
d.state.Unlock()
return nil, errors.New("reshare already in progress; use --force")
}
d.log.Info("reshare_setup", "already_in_progress", "restart", "reshare")
Expand Down
1 change: 1 addition & 0 deletions core/drand_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (d *Drand) PublicRandStream(req *drand.PublicRandRequest, stream drand.Publ
var b *beacon.Handler
d.state.Lock()
if d.beacon == nil {
d.state.Unlock()
return errors.New("beacon has not started on this node yet")
}
b = d.beacon
Expand Down

0 comments on commit 94a2942

Please sign in to comment.