multi: move LightningNode struct to models package

This commit is contained in:
Elle Mouton
2024-10-29 18:25:07 +02:00
parent ccb8f0eeb8
commit 6e13898981
20 changed files with 252 additions and 246 deletions

View File

@@ -1964,7 +1964,7 @@ func (d *AuthenticatedGossiper) addNode(msg *lnwire.NodeAnnouncement,
timestamp := time.Unix(int64(msg.Timestamp), 0)
features := lnwire.NewFeatureVector(msg.Features, lnwire.Features)
node := &graphdb.LightningNode{
node := &models.LightningNode{
HaveNodeAnnouncement: true,
LastUpdate: timestamp,
Addresses: msg.Addresses,

View File

@@ -93,7 +93,7 @@ type mockGraphSource struct {
bestHeight uint32
mu sync.Mutex
nodes []graphdb.LightningNode
nodes []models.LightningNode
infos map[uint64]models.ChannelEdgeInfo
edges map[uint64][]models.ChannelEdgePolicy
zombies map[uint64][][33]byte
@@ -113,7 +113,7 @@ func newMockRouter(height uint32) *mockGraphSource {
var _ graph.ChannelGraphSource = (*mockGraphSource)(nil)
func (r *mockGraphSource) AddNode(node *graphdb.LightningNode,
func (r *mockGraphSource) AddNode(node *models.LightningNode,
_ ...batch.SchedulerOption) error {
r.mu.Lock()
@@ -203,7 +203,7 @@ func (r *mockGraphSource) AddProof(chanID lnwire.ShortChannelID,
return nil
}
func (r *mockGraphSource) ForEachNode(func(node *graphdb.LightningNode) error) error {
func (r *mockGraphSource) ForEachNode(func(node *models.LightningNode) error) error {
return nil
}
@@ -280,7 +280,7 @@ func (r *mockGraphSource) GetChannelByID(chanID lnwire.ShortChannelID) (
}
func (r *mockGraphSource) FetchLightningNode(
nodePub route.Vertex) (*graphdb.LightningNode, error) {
nodePub route.Vertex) (*models.LightningNode, error) {
for _, node := range r.nodes {
if bytes.Equal(nodePub[:], node.PubKeyBytes[:]) {