htlcswitch: Only send UpdateFee message when channel is eligible
This commit adds a check to `updateChannelFee` which skipssending the `update_fee` message when the channel is not eligable for forwarding messages (likely due to the channel's `RemoteNextRevocation` not yet being set). This addresses #470.
This commit is contained in:
parent
0f3ff119e8
commit
720a8c7e96
@ -1140,6 +1140,14 @@ func (l *channelLink) updateChannelFee(feePerKw btcutil.Amount) error {
|
||||
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