Skip to content

Commit eb2b0c7

Browse files
committed
graph: fix staticcheck suggestion
From staticcheck: QF1002 - Convert untagged switch to tagged switch.
1 parent 001e559 commit eb2b0c7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

graph/builder.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,11 +1408,10 @@ func (b *Builder) processUpdate(msg interface{},
14081408
// check if we already have the most up-to-date information for
14091409
// that edge. If this message has a timestamp not strictly
14101410
// newer than what we already know of we can exit early.
1411-
switch {
1411+
switch msg.ChannelFlags & lnwire.ChanUpdateDirection {
14121412
// A flag set of 0 indicates this is an announcement for the
14131413
// "first" node in the channel.
1414-
case msg.ChannelFlags&lnwire.ChanUpdateDirection == 0:
1415-
1414+
case 0:
14161415
// Ignore outdated message.
14171416
if !edge1Timestamp.Before(msg.LastUpdate) {
14181417
return NewErrf(ErrOutdated, "Ignoring "+
@@ -1423,8 +1422,7 @@ func (b *Builder) processUpdate(msg interface{},
14231422

14241423
// Similarly, a flag set of 1 indicates this is an announcement
14251424
// for the "second" node in the channel.
1426-
case msg.ChannelFlags&lnwire.ChanUpdateDirection == 1:
1427-
1425+
case 1:
14281426
// Ignore outdated message.
14291427
if !edge2Timestamp.Before(msg.LastUpdate) {
14301428
return NewErrf(ErrOutdated, "Ignoring "+

0 commit comments

Comments
 (0)