htlcswitch: don't add UpdateFee to channel if not able to forward
This commit is a follow up to a prior commit which skipped sending the commitment sig message (and sending out the update fee) message if the channel wasn’t yet able to forward any HTLC’s. We’ll modify the prior commit to not add the fee update to the channel at all. Otherwise, we risk a state desynchronization.
This commit is contained in:
parent
ff6993bb5d
commit
c3d345b575
@ -1135,19 +1135,19 @@ func (l *channelLink) updateChannelFee(feePerKw btcutil.Amount) error {
|
||||
log.Infof("ChannelPoint(%v): updating commit fee to %v sat/kw", l,
|
||||
feePerKw)
|
||||
|
||||
// We skip sending the UpdateFee message if the channel is not
|
||||
// currently eligable to forward messages.
|
||||
if !l.EligibleToForward() {
|
||||
log.Debugf("ChannelPoint(%v): skipping fee update for " +
|
||||
"inactive channel")
|
||||
return nil
|
||||
}
|
||||
|
||||
// First, we'll update the local fee on our commitment.
|
||||
if err := l.channel.UpdateFee(feePerKw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// We skip sending the update_fee message if the channel is not currently
|
||||
// eligable to forward messages
|
||||
if !l.EligibleToForward() {
|
||||
log.Infof("ChannelPoint(%v): skipping transmission of update_fee. " +
|
||||
"channel is not eligable for forwarding messages")
|
||||
return nil
|
||||
}
|
||||
|
||||
// We'll then attempt to send a new UpdateFee message, and also lock it
|
||||
// in immediately by triggering a commitment update.
|
||||
msg := lnwire.NewUpdateFee(l.ChanID(), uint32(feePerKw))
|
||||
|
Loading…
Reference in New Issue
Block a user