From 6ec413b7adb88fcdf426d74997fa5590122dad60 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Tue, 23 May 2023 17:43:39 +0800 Subject: [PATCH] fix: not call RUnlock --- chain/messagepool/check.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chain/messagepool/check.go b/chain/messagepool/check.go index 17829057a..fdec910c4 100644 --- a/chain/messagepool/check.go +++ b/chain/messagepool/check.go @@ -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 { @@ -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 { @@ -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 {