breacharbiter: also listen for the co-op chan close signal

This commit is contained in:
Olaoluwa Osuntokun committed 2018-01-22 19:19:55 -08:00
1 parent 91d45b37ba
commit 0d75dde153
2 files changed
+19 -29

No files matched your search

+16
View File
@@ -544,6 +544,22 @@ func (b *breachArbiter) breachObserver(
case <-settleSignal:
return
// The channel has been closed cooperatively, so we're done here.
case <-chainEvents.CooperativeClosure:
// Launch a goroutine to cancel out this contract within the
// breachArbiter's main goroutine.
b.wg.Add(1)
go func() {
defer b.wg.Done()
select {
case b.settledContracts <- &chanPoint:
case <-b.quit:
}
}()
b.cfg.CloseLink(&chanPoint, htlcswitch.CloseBreach)
// The channel has been closed by a normal means: force closing with
// the latest commitment transaction.
case <-chainEvents.UnilateralClosure: