Skip to content

Commit

Permalink
fix: not call RUnlock
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed May 23, 2023
1 parent 2922959 commit 6ec413b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chain/messagepool/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (mp *MessagePool) CheckPendingMessages(ctx context.Context, from address.Ad
mp.lk.RLock()
mset, ok, err := mp.getPendingMset(ctx, from)
if err != nil {
mp.lk.RUnlock()
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
}
if ok {
Expand Down Expand Up @@ -70,6 +71,7 @@ func (mp *MessagePool) CheckReplaceMessages(ctx context.Context, replace []*type
msgMap[m.From] = mmap
mset, ok, err := mp.getPendingMset(ctx, m.From)
if err != nil {
mp.lk.RUnlock()
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
}
if ok {
Expand Down Expand Up @@ -153,6 +155,7 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
mp.lk.RLock()
mset, ok, err := mp.getPendingMset(ctx, m.From)
if err != nil {
mp.lk.RUnlock()
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
}
if ok && !interned {
Expand Down

0 comments on commit 6ec413b

Please sign in to comment.