-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Ipns/trickle append #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ipns/trickle append #867
Conversation
func (n *UnixfsNode) NumChildren() int { | ||
return n.ufmt.NumChildren() | ||
} | ||
|
||
func (n *UnixfsNode) GetChild(i int, ds dag.DAGService) (*UnixfsNode, error) { | ||
nd, err := n.node.Links[i].GetNode(ds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potential index out of range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as with any array access. Bounds should be checked prior to this call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question for sigh, github y u no refresh :)RemoveChild
and RemoveBlockSize()
f58c602
to
8eaf47b
Compare
|
||
// VerifyTrickleDagStructure checks that the given dag matches exactly the trickle dag datastructure | ||
// layout | ||
func VerifyTrickleDagStructure(nd *dag.Node, ds dag.DAGService, direct int, layerRepeat int) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbenet I thought you might like this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Some comments above to address, but otherwise LGTM |
57fb018
to
e539024
Compare
This implements an 'Append' function for adding data to an existing dag while keeping the structure. I also implement a validator function to ensure that the structure is what we expect.
This is PR number 3 of the ipns set