diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 8697624c..2ba04f55 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -359,21 +359,6 @@ func (l *channelLink) Start() error { log.Infof("ChannelLink(%v) is starting", l) - // Before we start the link, we'll update the ChainArbitrator with the - // set of new channel signals for this channel. - // - // TODO(roasbeef): split goroutines within channel arb to avoid - go func() { - err := l.cfg.UpdateContractSignals(&contractcourt.ContractSignals{ - HtlcUpdates: l.htlcUpdates, - ShortChanID: l.channel.ShortChanID(), - }) - if err != nil { - log.Errorf("Unable to update signals for "+ - "ChannelLink(%v)", l) - } - }() - l.mailBox.ResetMessages() l.overflowQueue.Start() @@ -401,6 +386,24 @@ func (l *channelLink) Start() error { return fmt.Errorf("unable to trim circuits above "+ "local htlc index %d: %v", localHtlcIndex, err) } + + // Since the link is live, before we start the link we'll update + // the ChainArbitrator with the set of new channel signals for + // this channel. + // + // TODO(roasbeef): split goroutines within channel arb to avoid + go func() { + signals := &contractcourt.ContractSignals{ + HtlcUpdates: l.htlcUpdates, + ShortChanID: l.channel.ShortChanID(), + } + + err := l.cfg.UpdateContractSignals(signals) + if err != nil { + log.Errorf("Unable to update signals for "+ + "ChannelLink(%v)", l) + } + }() } l.updateFeeTimer = time.NewTimer(l.randomFeeUpdateTimeout())