Skip to content

Commit

Permalink
routing: fix linter complains
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Jul 23, 2024
1 parent 5c137af commit c5066fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions htlcswitch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2886,9 +2886,10 @@ func (s *Switch) handlePacketAdd(packet *htlcPacket,
)
log.Warnf("unable to find err source for "+
"outgoing_link=%v, errors=%v",
packet.outgoingChanID, newLogClosure(func() string {
return spew.Sdump(linkErrs)
}))
packet.outgoingChanID, newLogClosure(
func() string {
return spew.Sdump(linkErrs)
}))
}

log.Tracef("incoming HTLC(%x) violated "+
Expand All @@ -2902,7 +2903,8 @@ func (s *Switch) handlePacketAdd(packet *htlcPacket,
// Choose a random link out of the set of links that can forward this
// htlc. The reason for randomization is to evenly distribute the htlc
// load without making assumptions about what the best channel is.
destination := destinations[rand.Intn(len(destinations))] // nolint:gosec
//nolint:gosec
destination := destinations[rand.Intn(len(destinations))]

// Retrieve the incoming link by its ShortChannelID. Note that the
// incomingChanID is never set to hop.Source here.
Expand Down
3 changes: 2 additions & 1 deletion routing/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,15 @@ func generateSphinxPacket(rt *route.Route, paymentHash []byte,
}

log.Tracef("Constructed per-hop payloads for payment_hash=%x: %v",
paymentHash[:], newLogClosure(func() string {
paymentHash, newLogClosure(func() string {
path := make(
[]sphinx.OnionHop, sphinxPath.TrueRouteLength(),
)
for i := range path {
hopCopy := sphinxPath[i]
path[i] = hopCopy
}

return spew.Sdump(path)
}),
)
Expand Down

0 comments on commit c5066fa

Please sign in to comment.