Commit cbc9a085 authored by Mildred Ki'Lya's avatar Mildred Ki'Lya Committed by Shanti Bouchez-Mongardé

merkledag: Remove cached Node.node

License: MIT
Signed-off-by: default avatarMildred Ki'Lya <mildred-pub.git@mildred.fr>
parent 8561017a
...@@ -48,9 +48,6 @@ type Link struct { ...@@ -48,9 +48,6 @@ type Link struct {
// multihash of the target object // multihash of the target object
Hash mh.Multihash Hash mh.Multihash
// a ptr to the actual node for graph manipulation
node *Node
} }
type LinkSlice []*Link type LinkSlice []*Link
...@@ -78,10 +75,6 @@ func MakeLink(n *Node) (*Link, error) { ...@@ -78,10 +75,6 @@ func MakeLink(n *Node) (*Link, error) {
// GetNode returns the MDAG Node that this link points to // GetNode returns the MDAG Node that this link points to
func (l *Link) GetNode(ctx context.Context, serv DAGService) (*Node, error) { func (l *Link) GetNode(ctx context.Context, serv DAGService) (*Node, error) {
if l.node != nil {
return l.node, nil
}
return serv.Get(ctx, key.Key(l.Hash)) return serv.Get(ctx, key.Key(l.Hash))
} }
...@@ -92,7 +85,6 @@ func (n *Node) AddNodeLink(name string, that *Node) error { ...@@ -92,7 +85,6 @@ func (n *Node) AddNodeLink(name string, that *Node) error {
lnk, err := MakeLink(that) lnk, err := MakeLink(that)
lnk.Name = name lnk.Name = name
lnk.node = that
if err != nil { if err != nil {
return err return err
} }
...@@ -122,7 +114,6 @@ func (n *Node) AddRawLink(name string, l *Link) error { ...@@ -122,7 +114,6 @@ func (n *Node) AddRawLink(name string, l *Link) error {
Name: name, Name: name,
Size: l.Size, Size: l.Size,
Hash: l.Hash, Hash: l.Hash,
node: l.node,
}) })
return nil return nil
...@@ -158,7 +149,6 @@ func (n *Node) GetNodeLink(name string) (*Link, error) { ...@@ -158,7 +149,6 @@ func (n *Node) GetNodeLink(name string) (*Link, error) {
Name: l.Name, Name: l.Name,
Size: l.Size, Size: l.Size,
Hash: l.Hash, Hash: l.Hash,
node: l.node,
}, nil }, nil
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment