multi: rename models.LightningNode to models.Node

This commit is contained in:
Elle Mouton committed 2025-09-03 10:14:35 +02:00
1 parent ea6cc8154f
commit c663a557c4
26 files changed
+212 -214

No files matched your search

+3 -3
View File
@@ -48,7 +48,7 @@ func ChannelGraphFromDatabase(db GraphSource) ChannelGraph {
}
// type dbNode is a wrapper struct around a database transaction an
// channeldb.LightningNode. The wrapper method implement the autopilot.Node
// channeldb.Node. The wrapper method implement the autopilot.Node
// interface.
type dbNode struct {
pub [33]byte
@@ -84,7 +84,7 @@ func (d *dbNode) Addrs() []net.Addr {
func (d *databaseChannelGraph) ForEachNode(ctx context.Context,
cb func(context.Context, Node) error, reset func()) error {
return d.db.ForEachNode(ctx, func(n *models.LightningNode) error {
return d.db.ForEachNode(ctx, func(n *models.Node) 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.
@@ -161,7 +161,7 @@ func ChannelGraphFromCachedDatabase(db GraphSource) ChannelGraph {
}
// dbNodeCached is a wrapper struct around a database transaction for a
// channeldb.LightningNode. The wrapper methods implement the autopilot.Node
// channeldb.Node. The wrapper methods implement the autopilot.Node
// interface.
type dbNodeCached struct {
node route.Vertex
+1 -1
View File
@@ -230,7 +230,7 @@ type GraphSource interface {
// graph, executing the passed callback with each node encountered. If
// the callback returns an error, then the transaction is aborted and
// the iteration stops early.
ForEachNode(context.Context, func(*models.LightningNode) error,
ForEachNode(context.Context, func(*models.Node) error,
func()) error
// ForEachNodeCached is similar to ForEachNode, but it utilizes the
+4 -4
View File
@@ -403,7 +403,7 @@ func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
ctx := context.Background()
fetchNode := func(pub *btcec.PublicKey) (*models.LightningNode, error) {
fetchNode := func(pub *btcec.PublicKey) (*models.Node, error) {
if pub != nil {
vertex, err := route.NewVertexFromBytes(
pub.SerializeCompressed(),
@@ -417,7 +417,7 @@ func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
case errors.Is(err, graphdb.ErrGraphNodeNotFound):
fallthrough
case errors.Is(err, graphdb.ErrGraphNotFound):
graphNode := &models.LightningNode{
graphNode := &models.Node{
HaveNodeAnnouncement: true,
Addresses: []net.Addr{&net.TCPAddr{
IP: bytes.Repeat(
@@ -447,7 +447,7 @@ func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
if err != nil {
return nil, err
}
dbNode := &models.LightningNode{
dbNode := &models.Node{
HaveNodeAnnouncement: true,
Addresses: []net.Addr{
&net.TCPAddr{
@@ -548,7 +548,7 @@ func (d *testDBGraph) addRandNode() (*btcec.PublicKey, error) {
if err != nil {
return nil, err
}
dbNode := &models.LightningNode{
dbNode := &models.Node{
HaveNodeAnnouncement: true,
Addresses: []net.Addr{
&net.TCPAddr{