File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -296,14 +296,19 @@ func (o *Ouroboros) setupConnection() error {
296296 o .waitGroup .Add (1 )
297297 go func () {
298298 defer o .waitGroup .Done ()
299- err , ok := <- o . protoErrorChan
300- // The channel is closed, which means we're already shutting down
301- if ! ok {
299+ select {
300+ case <- o . doneChan :
301+ // Return if we're shutting down
302302 return
303+ case err , ok := <- o .protoErrorChan :
304+ // The channel is closed, which means we're already shutting down
305+ if ! ok {
306+ return
307+ }
308+ o .errorChan <- fmt .Errorf ("protocol error: %s" , err )
309+ // Close connection on mini-protocol errors
310+ o .Close ()
303311 }
304- o .errorChan <- fmt .Errorf ("protocol error: %s" , err )
305- // Close connection on mini-protocol errors
306- o .Close ()
307312 }()
308313 // Configure the relevant mini-protocols
309314 if o .useNodeToNodeProto {
You can’t perform that action at this time.
0 commit comments