Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
4c348701
Commit
4c348701
authored
Jul 16, 2017
by
Jeromy Johnson
Committed by
GitHub
Jul 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4072 from ipfs/fix/dag-put-order
fix determination of 'root' node in dag put
parents
19e1e091
7f89e09d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
core/commands/dag/dag.go
core/commands/dag/dag.go
+9
-6
No files found.
core/commands/dag/dag.go
View file @
4c348701
...
...
@@ -79,25 +79,28 @@ into an object of the specified format.
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
if
len
(
nds
)
==
0
{
res
.
SetError
(
fmt
.
Errorf
(
"no node returned from ParseInputs"
),
cmds
.
ErrNormal
)
return
}
var
c
*
cid
.
Cid
b
:=
n
.
DAG
.
Batch
()
for
_
,
nd
:=
range
nds
{
cid
,
err
:=
b
.
Add
(
nd
)
_
,
err
:=
b
.
Add
(
nd
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
c
=
cid
}
if
err
:=
b
.
Commit
();
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
root
:=
nds
[
0
]
.
Cid
()
if
dopin
{
n
.
Pinning
.
PinWithMode
(
c
,
pin
.
Recursive
)
n
.
Pinning
.
PinWithMode
(
root
,
pin
.
Recursive
)
err
:=
n
.
Pinning
.
Flush
()
if
err
!=
nil
{
...
...
@@ -106,7 +109,7 @@ into an object of the specified format.
}
}
res
.
SetOutput
(
&
OutputObject
{
Cid
:
c
})
res
.
SetOutput
(
&
OutputObject
{
Cid
:
root
})
},
Type
:
OutputObject
{},
Marshalers
:
cmds
.
MarshalerMap
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment