Skip to content

Commit

Permalink
removing lock when processing partial (#732)
Browse files Browse the repository at this point in the history
* removing lock when processing partial

Co-authored-by: Will Scott <will@cypherpunk.email>
  • Loading branch information
nikkolasg and willscott committed Aug 4, 2020
1 parent 84eedb1 commit 8dc353a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/drand_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ func (d *Drand) BroadcastDKG(c context.Context, in *drand.DKGPacket) (*drand.Emp
// with the partial signature from this drand node.
func (d *Drand) PartialBeacon(c context.Context, in *drand.PartialBeaconPacket) (*drand.Empty, error) {
d.state.Lock()
defer d.state.Unlock()
if d.beacon == nil {
d.state.Unlock()
return nil, errors.New("drand: beacon not setup yet")
}
return d.beacon.ProcessPartialBeacon(c, in)
inst := d.beacon
d.state.Unlock()
return inst.ProcessPartialBeacon(c, in)
}

// PublicRand returns a public random beacon according to the request. If the Round
Expand Down

0 comments on commit 8dc353a

Please sign in to comment.