Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02e14c4

Browse files
committedNov 17, 2015
comment multiple dagstore error checking
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent e002194 commit 02e14c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎merkledag/utils/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.Node, path []st
9898
nd = create()
9999
err = nil // no longer an error case
100100
} else if err == dag.ErrNotFound {
101+
// try finding it in our source dagstore
101102
nd, err = root.GetLinkedNode(ctx, e.src, path[0])
102103
}
103104

105+
// if we receive an ErrNotFound, then our second 'GetLinkedNode' call
106+
// also fails, we want to error out
104107
if err != nil {
105108
return nil, err
106109
}
@@ -153,6 +156,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.Node, path []string) (*da
153156
return root, nil
154157
}
155158

159+
// search for node in both tmp dagstore and source dagstore
156160
nd, err := root.GetLinkedNode(ctx, e.tmp, path[0])
157161
if err == dag.ErrNotFound {
158162
nd, err = root.GetLinkedNode(ctx, e.src, path[0])

0 commit comments

Comments
 (0)
Please sign in to comment.