From 4f758eb5496a34a53329fc33aa04555173b62983 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 4 May 2017 16:07:25 -0700 Subject: [PATCH] breacharbiter: modify db API usage to match recent changes --- breacharbiter.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/breacharbiter.go b/breacharbiter.go index 796066561..833393dd4 100644 --- a/breacharbiter.go +++ b/breacharbiter.go @@ -374,7 +374,14 @@ func (b *breachArbiter) breachObserver(contract *lnwallet.LightningChannel, // multi-hop HTLCs aren't sent over this link, nor any other // links associated with this peer. b.htlcSwitch.CloseLink(chanPoint, CloseBreach) - if err := contract.DeleteState(); err != nil { + closeInfo := &channeldb.ChannelCloseSummary{ + ChanPoint: *chanPoint, + ClosingTXID: breachInfo.BreachTransaction.TxHash(), + OurBalance: contract.StateSnapshot().LocalBalance, + IsPending: true, + CloseType: channeldb.BreachClose, + } + if err := contract.DeleteState(closeInfo); err != nil { brarLog.Errorf("unable to delete channel state: %v", err) } @@ -432,7 +439,7 @@ func (b *breachArbiter) breachObserver(contract *lnwallet.LightningChannel, doneChan: make(chan struct{}), } - // TODO(roasbeef): delete chan state on unilateral close also? + case <-b.quit: return }