Commit a167f177 authored by Łukasz Magiera's avatar Łukasz Magiera

merkledag/utils: switch copyDag to node.Node

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent f0dc6dbc
......@@ -194,7 +194,7 @@ func (e *Editor) Finalize(ds dag.DAGService) (*dag.ProtoNode, error) {
return nd, err
}
func copyDag(nd *dag.ProtoNode, from, to dag.DAGService) error {
func copyDag(nd node.Node, from, to dag.DAGService) error {
_, err := to.Add(nd)
if err != nil {
return err
......@@ -211,13 +211,7 @@ func copyDag(nd *dag.ProtoNode, from, to dag.DAGService) error {
return err
}
childpb, ok := child.(*dag.ProtoNode)
if !ok { // leaf node
_, err := to.Add(nd)
return err
}
err = copyDag(childpb, from, to)
err = copyDag(child, from, to)
if err != nil {
return err
}
......
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