multi: fix linter errors

This commit is contained in:
Elle Mouton
2024-10-24 15:14:28 +02:00
parent fd2ea411be
commit 4089fbcb44
11 changed files with 276 additions and 186 deletions

View File

@@ -3,6 +3,7 @@ package autopilot
import (
"bytes"
"encoding/hex"
"errors"
"net"
"sort"
"sync/atomic"
@@ -134,7 +135,9 @@ func (d *dbNode) ForEachChannel(cb func(ChannelEdge) error) error {
//
// NOTE: Part of the autopilot.ChannelGraph interface.
func (d *databaseChannelGraph) ForEachNode(cb func(Node) error) error {
return d.db.ForEachNode(func(tx kvdb.RTx, n *models.LightningNode) error {
return d.db.ForEachNode(func(tx kvdb.RTx,
n *models.LightningNode) error {
// We'll skip over any node that doesn't have any advertised
// addresses. As we won't be able to reach them to actually
// open any channels.
@@ -168,9 +171,9 @@ func (d *databaseChannelGraph) addRandChannel(node1, node2 *btcec.PublicKey,
dbNode, err := d.db.FetchLightningNode(vertex)
switch {
case err == graphdb.ErrGraphNodeNotFound:
case errors.Is(err, graphdb.ErrGraphNodeNotFound):
fallthrough
case err == graphdb.ErrGraphNotFound:
case errors.Is(err, graphdb.ErrGraphNotFound):
graphNode := &models.LightningNode{
HaveNodeAnnouncement: true,
Addresses: []net.Addr{