graph: fix staticcheck suggestion

From staticcheck: QF1002 - Convert untagged switch to tagged switch.
This commit is contained in:
yyforyongyu 2025-01-17 00:18:47 +08:00
parent 001e5599b6
commit eb2b0c783f
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -1408,11 +1408,10 @@ func (b *Builder) processUpdate(msg interface{},
// check if we already have the most up-to-date information for
// that edge. If this message has a timestamp not strictly
// newer than what we already know of we can exit early.
switch {
switch msg.ChannelFlags & lnwire.ChanUpdateDirection {
// A flag set of 0 indicates this is an announcement for the
// "first" node in the channel.
case msg.ChannelFlags&lnwire.ChanUpdateDirection == 0:
case 0:
// Ignore outdated message.
if !edge1Timestamp.Before(msg.LastUpdate) {
return NewErrf(ErrOutdated, "Ignoring "+
@ -1423,8 +1422,7 @@ func (b *Builder) processUpdate(msg interface{},
// Similarly, a flag set of 1 indicates this is an announcement
// for the "second" node in the channel.
case msg.ChannelFlags&lnwire.ChanUpdateDirection == 1:
case 1:
// Ignore outdated message.
if !edge2Timestamp.Before(msg.LastUpdate) {
return NewErrf(ErrOutdated, "Ignoring "+