contractcourt: process channel close event on new beat

This commit is contained in:
yyforyongyu committed 2024-12-20 17:54:07 +08:00
1 parent c5b3033427
commit a6d3a0fa99
3 files changed
+86 -5

No files matched your search

+7 -5
View File
@@ -578,9 +578,6 @@ func (c *ChainArbitrator) Start(beat chainio.Blockbeat) error {
// Set the current beat.
c.beat = beat
log.Infof("ChainArbitrator starting at height %d with budget=[%v]",
&c.cfg.Budget, c.beat.Height())
// First, we'll fetch all the channels that are still open, in order to
// collect them within our set of active contracts.
if err := c.loadOpenChannels(); err != nil {
@@ -690,6 +687,11 @@ func (c *ChainArbitrator) Start(beat chainio.Blockbeat) error {
c.dispatchBlocks()
}()
log.Infof("ChainArbitrator starting at height %d with %d chain "+
"watchers, %d channel arbitrators, and budget config=[%v]",
c.beat.Height(), len(c.activeWatchers), len(c.activeChannels),
&c.cfg.Budget)
// TODO(roasbeef): eventually move all breach watching here
return nil
@@ -1061,8 +1063,8 @@ func (c *ChainArbitrator) WatchNewChannel(newChan *channeldb.OpenChannel) error
chanPoint := newChan.FundingOutpoint
log.Infof("Creating new ChannelArbitrator for ChannelPoint(%v)",
chanPoint)
log.Infof("Creating new chainWatcher and ChannelArbitrator for "+
"ChannelPoint(%v)", chanPoint)
// If we're already watching this channel, then we'll ignore this
// request.