peer: add conditional sends on quit within readHandler message dispatch

This commit is contained in:
Olaoluwa Osuntokun 2017-09-27 20:18:20 -07:00
parent c06b82c3a2
commit ab25b636f5
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

12
peer.go

@ -641,9 +641,17 @@ out:
p.server.fundingMgr.processFundingLocked(msg, p.addr)
case *lnwire.Shutdown:
p.shutdownChanReqs <- msg
select {
case p.shutdownChanReqs <- msg:
case <-p.quit:
break out
}
case *lnwire.ClosingSigned:
p.closingSignedChanReqs <- msg
select {
case p.closingSignedChanReqs <- msg:
case <-p.quit:
break out
}
case *lnwire.Error:
p.server.fundingMgr.processFundingError(msg, p.addr)