htlcswitch/link: only update contract signals on start if live link
This commit is contained in:
parent
5f90973f76
commit
b507d265b4
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user