mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
955a345153
Without this the following could happen: * InboundPeerConnected is called while we already have an inbound connection with the peer. This calls removePeer which calls Disconnect. * If the peer is starting up in Start, it may be sending messages synchronously via SendMessage(true, ...). This eventually calls the writeMessage function which will exit if disconnect is set to 1. * Since Disconnect was called, disconnect will be 1 and writeMessage will exit, causing writeHandler to exit. * If there is more than 1 message being sent, later messages will queue in queueHandler but be unable to get into sendQueue as the writeHandler goroutine has exited. * The synchronous sends will be waiting on the errChan indefinitely and startReady will never get closed meaning Disconnect will never proceed. The end result is that the server's mutex will be held until shutdown. Avoid this by using writeMessage to bypass the writeHandler goroutine. |
||
---|---|---|
.. | ||
brontide_test.go | ||
brontide.go | ||
interfaces.go | ||
log.go | ||
musig_chan_closer.go | ||
ping_manager_test.go | ||
ping_manager.go | ||
test_utils.go |