mempool: remove lock indirection from the Pool

After the f0bb886be3 with all methods of Pool
being pointer-based it makes no sense having this lock as a pointer.
This commit is contained in:
Roman Khimov 2020-02-05 14:27:03 +03:00
parent a928ad9cfa
commit e01bfeeb4d

View file

@ -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,