deprecate merkledag.Node.Update

This commit is contained in:
Juan Batiz-Benet 2014-10-08 03:11:29 -07:00
parent 459e0d5373
commit cf6efc7a09
2 changed files with 1 additions and 25 deletions

View File

@ -26,6 +26,7 @@ func NewDagReader(n *Node, serv *DAGService) (io.Reader, error) {
if err != nil {
return nil, err
}
switch pb.GetType() {
case ft.PBData_Directory:
return nil, ErrIsDir

View File

@ -138,31 +138,6 @@ func (n *Node) Key() (u.Key, error) {
return u.Key(h), err
}
// Recursively update all hash links and size values in the tree
func (n *Node) Update() error {
log.Debug("node update")
for _, l := range n.Links {
if l.Node != nil {
err := l.Node.Update()
if err != nil {
return err
}
nhash, err := l.Node.Multihash()
if err != nil {
return err
}
l.Hash = nhash
size, err := l.Node.Size()
if err != nil {
return err
}
l.Size = size
}
}
_, err := n.Encoded(true)
return err
}
// DAGService is an IPFS Merkle DAG service.
// - the root is virtual (like a forest)
// - stores nodes' data in a BlockService