From e01bfeeb4d04eb4c7b6d0e1c20a44ecc53abb32d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 5 Feb 2020 14:27:03 +0300 Subject: [PATCH] mempool: remove lock indirection from the Pool After the f0bb886be333d268ec72faca5c0e1fee50782f51 with all methods of Pool being pointer-based it makes no sense having this lock as a pointer. --- pkg/core/mempool/mem_pool.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/core/mempool/mem_pool.go b/pkg/core/mempool/mem_pool.go index aa28b04a8..13e6689e1 100644 --- a/pkg/core/mempool/mem_pool.go +++ b/pkg/core/mempool/mem_pool.go @@ -35,7 +35,7 @@ type items []*item // Pool stores the unconfirms transactions. type Pool struct { - lock *sync.RWMutex + lock sync.RWMutex unsortedTxn map[util.Uint256]*item unverifiedTxn map[util.Uint256]*item sortedHighPrioTxn items @@ -232,7 +232,6 @@ func (mp *Pool) RemoveOverCapacity() { // NewMemPool returns a new Pool struct. func NewMemPool(capacity int) Pool { return Pool{ - lock: new(sync.RWMutex), unsortedTxn: make(map[util.Uint256]*item), unverifiedTxn: make(map[util.Uint256]*item), capacity: capacity,