Skip to content

Commit bc94cda

Browse files
committed
review changes
1 parent 9c154d5 commit bc94cda

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

bitswap/client/internal/messagequeue/messagequeue.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,6 @@ func newMessageQueue(
333333
}
334334
}
335335

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-
344336
// Add want-haves that are part of a broadcast to all connected peers
345337
func (mq *MessageQueue) AddBroadcastWantHaves(wantHaves []cid.Cid) {
346338
if len(wantHaves) == 0 {

bitswap/client/internal/peermanager/peermanager.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,18 @@ func (pm *PeerManager) Connected(p peer.ID) {
9595
// Disconnected is called to remove a peer from the pool.
9696
func (pm *PeerManager) Disconnected(p peer.ID) {
9797
pm.pqLk.Lock()
98-
defer pm.pqLk.Unlock()
9998

10099
pq, ok := pm.peerQueues[p]
101100
if !ok {
101+
pm.pqLk.Unlock()
102102
return
103103
}
104104
// Clean up the peer
105105
delete(pm.peerQueues, p)
106106
pm.pwm.removePeer(p)
107107

108+
pm.pqLk.Unlock()
109+
108110
// Inform the sessions that the peer has disconnected
109111
pm.signalAvailability(p, false)
110112

0 commit comments

Comments
 (0)