mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
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:
parent
a928ad9cfa
commit
e01bfeeb4d
1 changed files with 1 additions and 2 deletions
|
@ -35,7 +35,7 @@ type items []*item
|
||||||
|
|
||||||
// Pool stores the unconfirms transactions.
|
// Pool stores the unconfirms transactions.
|
||||||
type Pool struct {
|
type Pool struct {
|
||||||
lock *sync.RWMutex
|
lock sync.RWMutex
|
||||||
unsortedTxn map[util.Uint256]*item
|
unsortedTxn map[util.Uint256]*item
|
||||||
unverifiedTxn map[util.Uint256]*item
|
unverifiedTxn map[util.Uint256]*item
|
||||||
sortedHighPrioTxn items
|
sortedHighPrioTxn items
|
||||||
|
@ -232,7 +232,6 @@ func (mp *Pool) RemoveOverCapacity() {
|
||||||
// NewMemPool returns a new Pool struct.
|
// NewMemPool returns a new Pool struct.
|
||||||
func NewMemPool(capacity int) Pool {
|
func NewMemPool(capacity int) Pool {
|
||||||
return Pool{
|
return Pool{
|
||||||
lock: new(sync.RWMutex),
|
|
||||||
unsortedTxn: make(map[util.Uint256]*item),
|
unsortedTxn: make(map[util.Uint256]*item),
|
||||||
unverifiedTxn: make(map[util.Uint256]*item),
|
unverifiedTxn: make(map[util.Uint256]*item),
|
||||||
capacity: capacity,
|
capacity: capacity,
|
||||||
|
|
Loading…
Reference in a new issue