From 9f031b9601fdcd35a6760df9e8fca470484805c0 Mon Sep 17 00:00:00 2001 From: tony Date: Tue, 18 Jul 2023 13:43:44 +0800 Subject: [PATCH] fix unexpected race in tx subscription --- api/subscriptions/pending_tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/subscriptions/pending_tx.go b/api/subscriptions/pending_tx.go index 431f29f1e..e8b2d065a 100644 --- a/api/subscriptions/pending_tx.go +++ b/api/subscriptions/pending_tx.go @@ -72,7 +72,7 @@ func (p *pendingTx) DispatchLoop(done <-chan struct{}) { func (p *pendingTx) dispatch(tx *tx.Transaction, done <-chan struct{}) { p.mu.RLock() - defer p.mu.Unlock() + defer p.mu.RUnlock() for lsn := range p.listeners { select {