From 184d8a0180f6bbb930c75be6041d13e9f87521f5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 24 Oct 2019 12:12:29 +0300 Subject: [PATCH] core: fix missing unlock in MemPool TryAdd() Fixes deadlock on subsequent MemPool operations. --- pkg/core/mem_pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/core/mem_pool.go b/pkg/core/mem_pool.go index 1c8396719..1a6f148c2 100644 --- a/pkg/core/mem_pool.go +++ b/pkg/core/mem_pool.go @@ -106,6 +106,7 @@ func (mp MemPool) TryAdd(hash util.Uint256, pItem *PoolItem) bool { mp.lock.RLock() if _, ok := mp.unsortedTxn[hash]; ok { + mp.lock.RUnlock() return false } mp.unsortedTxn[hash] = pItem