Merge pull request #509 from halseth/fix-sendtopeer-deadlock
[trivial] server: fix deadlock in sendToPeer at peer shutdown
This commit is contained in:
commit
3f2a5241c1
@ -958,6 +958,8 @@ func (s *server) sendToPeer(target *btcec.PublicKey,
|
|||||||
select {
|
select {
|
||||||
case err := <-errChan:
|
case err := <-errChan:
|
||||||
return err
|
return err
|
||||||
|
case <-targetPeer.quit:
|
||||||
|
return fmt.Errorf("peer shutting down")
|
||||||
case <-s.quit:
|
case <-s.quit:
|
||||||
return ErrServerShuttingDown
|
return ErrServerShuttingDown
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user