diff --git a/mempool/clist/clist.go b/mempool/clist/clist.go index 29f7f537900..e565cc30991 100644 --- a/mempool/clist/clist.go +++ b/mempool/clist/clist.go @@ -14,8 +14,6 @@ to ensure garbage collection of removed elements. import ( "fmt" "sync" - - cmsync "github.com/cometbft/cometbft/libs/sync" ) // MaxLength is the max allowed number of elements a linked list is @@ -42,7 +40,7 @@ and there's no reason to serialize that condition for goroutines waiting on NextWait() (since it's just a read operation). */ type CElement struct { - mtx cmsync.RWMutex + mtx sync.RWMutex prev *CElement prevWg *sync.WaitGroup prevWaitCh chan struct{} @@ -218,7 +216,7 @@ func (e *CElement) SetRemoved() { // Operations are goroutine-safe. // Panics if length grows beyond the max. type CList struct { - mtx cmsync.RWMutex + mtx sync.RWMutex wg *sync.WaitGroup waitCh chan struct{} head *CElement // first element diff --git a/node/mempool.go b/node/mempool.go index 1884b130ff5..214e8c18568 100644 --- a/node/mempool.go +++ b/node/mempool.go @@ -3,8 +3,8 @@ package node import ( "fmt" "math" + "sync" - cmsync "github.com/cometbft/cometbft/libs/sync" "github.com/libp2p/go-libp2p/core/peer" ) @@ -13,7 +13,7 @@ const ( ) type mempoolIDs struct { - mtx cmsync.RWMutex + mtx sync.RWMutex peerMap map[peer.ID]uint16 nextID uint16 // assumes that a node will never have over 65536 active peers activeIDs map[uint16]struct{} // used to check if a given peerID key is used, the value doesn't matter