peer: ensure a peer can exit mid cooperative closure
This commit adds another conditional send select statement to ensure that when sending the finalized contract to the breach arbiter, the peer doesn’t possible cause the daemon to hang on shutdown.
This commit is contained in:
parent
c09713ebd1
commit
3086a9d06a
5
peer.go
5
peer.go
@ -1446,6 +1446,11 @@ func (p *peer) handleClosingSigned(localReq *htlcswitch.ChanClose,
|
||||
// Once we've completed the cooperative channel closure, we'll wipe the
|
||||
// channel so we reject any incoming forward or payment requests via
|
||||
// this channel.
|
||||
select {
|
||||
case p.server.breachArbiter.settledContracts <- chanPoint:
|
||||
case <-p.server.quit:
|
||||
return nil, 0
|
||||
}
|
||||
if err := p.WipeChannel(channel); err != nil {
|
||||
if localReq != nil {
|
||||
localReq.Err <- err
|
||||
|
Loading…
Reference in New Issue
Block a user