contractcourt: extend resolveContract to also stop any active chainWatcher
This commit is contained in:
parent
723bfb0eac
commit
bdbb33344a
@ -273,17 +273,24 @@ func (c *ChainArbitrator) resolveContract(chanPoint wire.OutPoint,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once this has been marked as resolved, we'll wipe the log that the
|
if arbLog != nil {
|
||||||
// channel arbitrator was using to store its persistent state. We do
|
// Once this has been marked as resolved, we'll wipe the log
|
||||||
// this after marking the channel resolved, as otherwise, the
|
// that the channel arbitrator was using to store its
|
||||||
// arbitrator would be re-created, and think it was starting from the
|
// persistent state. We do this after marking the channel
|
||||||
// default state.
|
// resolved, as otherwise, the arbitrator would be re-created,
|
||||||
|
// and think it was starting from the default state.
|
||||||
if err := arbLog.WipeHistory(); err != nil {
|
if err := arbLog.WipeHistory(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c.Lock()
|
c.Lock()
|
||||||
delete(c.activeChannels, chanPoint)
|
delete(c.activeChannels, chanPoint)
|
||||||
|
|
||||||
|
chainWatcher, ok := c.activeWatchers[chanPoint]
|
||||||
|
if ok {
|
||||||
|
chainWatcher.Stop()
|
||||||
|
}
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user