We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c488a1c commit 73b5302Copy full SHA for 73b5302
p2p/protocol/identify/peer_loop.go
@@ -115,17 +115,17 @@ func (ph *peerHandler) sendDelta(ctx context.Context) error {
115
return nil
116
}
117
118
- ph.ids.pushSemaphore <- struct{}{}
119
- defer func() {
120
- <-ph.ids.pushSemaphore
121
- }()
122
-
123
// extract a delta message, updating the last state.
124
mes := ph.nextDelta()
125
if mes == nil || (len(mes.AddedProtocols) == 0 && len(mes.RmProtocols) == 0) {
126
127
128
+ ph.ids.pushSemaphore <- struct{}{}
+ defer func() {
+ <-ph.ids.pushSemaphore
+ }()
+
129
ds, err := ph.openStream(ctx, []string{IDDelta})
130
if err != nil {
131
return fmt.Errorf("failed to open delta stream: %w", err)
0 commit comments