fix(events): unlock mutex before error returns
This commit is contained in:
parent
a999e41677
commit
c6f5214657
@ -153,6 +153,7 @@ func (e *heightEvents) ChainAt(hnd HeightHandler, rev RevertHandler, confidence
|
|||||||
|
|
||||||
best, err := e.tsc.best()
|
best, err := e.tsc.best()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
e.lk.Unlock()
|
||||||
return xerrors.Errorf("error getting best tipset: %w", err)
|
return xerrors.Errorf("error getting best tipset: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +178,7 @@ func (e *heightEvents) ChainAt(hnd HeightHandler, rev RevertHandler, confidence
|
|||||||
e.lk.Lock()
|
e.lk.Lock()
|
||||||
best, err = e.tsc.best()
|
best, err = e.tsc.best()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
e.lk.Unlock()
|
||||||
return xerrors.Errorf("error getting best tipset: %w", err)
|
return xerrors.Errorf("error getting best tipset: %w", err)
|
||||||
}
|
}
|
||||||
bestH = best.Height()
|
bestH = best.Height()
|
||||||
|
Loading…
Reference in New Issue
Block a user