Skip to content

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

Merged
merged 2 commits into from
Mar 9, 2015
Merged

Ipns/trickle append #867

merged 2 commits into from
Mar 9, 2015

Conversation

whyrusleeping
Copy link
Member

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

@whyrusleeping whyrusleeping added the status/in-progress In progress label Mar 6, 2015
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)
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question for RemoveChild and RemoveBlockSize() sigh, github y u no refresh :)


// 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 {
Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jbenet
Copy link
Member

jbenet commented Mar 7, 2015

Some comments above to address, but otherwise LGTM

jbenet added a commit that referenced this pull request Mar 9, 2015
@jbenet jbenet merged commit 1011067 into master Mar 9, 2015
@jbenet jbenet deleted the ipns/trickle-append branch March 9, 2015 07:36
@jbenet jbenet removed the status/in-progress In progress label Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants