breacharbiter: modify db API usage to match recent changes

This commit is contained in:
Olaoluwa Osuntokun 2017-05-04 16:07:25 -07:00
parent 36fe8a730e
commit 4f758eb549
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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
}