File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -333,14 +333,6 @@ func newMessageQueue(
333
333
}
334
334
}
335
335
336
- func (mq * MessageQueue ) Sync () <- chan struct {} {
337
- done := make (chan struct {})
338
- mq .requests .In () <- func () {
339
- close (done )
340
- }
341
- return done
342
- }
343
-
344
336
// Add want-haves that are part of a broadcast to all connected peers
345
337
func (mq * MessageQueue ) AddBroadcastWantHaves (wantHaves []cid.Cid ) {
346
338
if len (wantHaves ) == 0 {
Original file line number Diff line number Diff line change @@ -95,16 +95,18 @@ func (pm *PeerManager) Connected(p peer.ID) {
95
95
// Disconnected is called to remove a peer from the pool.
96
96
func (pm * PeerManager ) Disconnected (p peer.ID ) {
97
97
pm .pqLk .Lock ()
98
- defer pm .pqLk .Unlock ()
99
98
100
99
pq , ok := pm .peerQueues [p ]
101
100
if ! ok {
101
+ pm .pqLk .Unlock ()
102
102
return
103
103
}
104
104
// Clean up the peer
105
105
delete (pm .peerQueues , p )
106
106
pm .pwm .removePeer (p )
107
107
108
+ pm .pqLk .Unlock ()
109
+
108
110
// Inform the sessions that the peer has disconnected
109
111
pm .signalAvailability (p , false )
110
112
You can’t perform that action at this time.
0 commit comments