diff --git a/channeldb/graph.go b/channeldb/graph.go index 0b7746b6a..f34fe0b27 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -1939,7 +1939,6 @@ func (c *ChannelGraph) ChanUpdatesInHorizon(startTime, return fmt.Errorf("unable to fetch info for "+ "edge with chan_id=%v: %v", chanID, err) } - edgeInfo.db = c.db // With the static information obtained, we'll now // fetch the dynamic policy info. @@ -2270,7 +2269,6 @@ func (c *ChannelGraph) FetchChanInfos(chanIDs []uint64) ([]ChannelEdge, error) { case err != nil: return err } - edgeInfo.db = c.db // With the static information obtained, we'll now // fetch the dynamic policy info. @@ -2961,7 +2959,6 @@ func nodeTraversal(tx kvdb.RTx, nodePub []byte, db kvdb.Backend, if err != nil { return err } - edgeInfo.db = db outgoingPolicy, err := fetchChanEdgePolicy( edges, chanID, nodePub, nodes, @@ -3082,8 +3079,6 @@ type ChannelEdgeInfo struct { // and ensure we're able to make upgrades to the network in a forwards // compatible manner. ExtraOpaqueData []byte - - db kvdb.Backend } // AddNodeKeys is a setter-like method that can be used to replace the set of @@ -3560,7 +3555,6 @@ func (c *ChannelGraph) FetchChannelEdgesByOutpoint(op *wire.OutPoint, return err } edgeInfo = &edge - edgeInfo.db = c.db // Once we have the information about the channels' parameters, // we'll fetch the routing policies for each for the directed @@ -3666,7 +3660,6 @@ func (c *ChannelGraph) FetchChannelEdgesByID(chanID uint64, } edgeInfo = &edge - edgeInfo.db = c.db // Then we'll attempt to fetch the accompanying policies of this // edge. diff --git a/channeldb/graph_test.go b/channeldb/graph_test.go index 0e13e915d..a1e6fa223 100644 --- a/channeldb/graph_test.go +++ b/channeldb/graph_test.go @@ -2706,16 +2706,14 @@ func TestNodeIsPublic(t *testing.T) { // participant's graph. nodes := []*LightningNode{aliceNode, bobNode, carolNode} edges := []*ChannelEdgeInfo{&aliceBobEdge, &bobCarolEdge} - dbs := []kvdb.Backend{aliceGraph.db, bobGraph.db, carolGraph.db} graphs := []*ChannelGraph{aliceGraph, bobGraph, carolGraph} - for i, graph := range graphs { + for _, graph := range graphs { for _, node := range nodes { if err := graph.AddLightningNode(node); err != nil { t.Fatalf("unable to add node: %v", err) } } for _, edge := range edges { - edge.db = dbs[i] if err := graph.AddChannelEdge(edge); err != nil { t.Fatalf("unable to add edge: %v", err) } @@ -2775,7 +2773,7 @@ func TestNodeIsPublic(t *testing.T) { // that allows it to be advertised. Within Alice's graph, we'll // completely remove the edge as it is not possible for her to know of // it without it being advertised. - for i, graph := range graphs { + for _, graph := range graphs { err := graph.DeleteChannelEdges( false, true, bobCarolEdge.ChannelID, ) @@ -2788,7 +2786,6 @@ func TestNodeIsPublic(t *testing.T) { } bobCarolEdge.AuthProof = nil - bobCarolEdge.db = dbs[i] if err := graph.AddChannelEdge(&bobCarolEdge); err != nil { t.Fatalf("unable to add edge: %v", err) }