Skip to content

Commit 1f399ec

Browse files
committed
proof: making diagrams can have their own insights
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent 8c88c4d commit 1f399ec

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

proof.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
)
2222

2323
func ValidateProof(ctx context.Context, root cid.Cid, offset uint64, proof []byte) (bool, error) {
24-
fmt.Printf("Validating %s\n", root)
2524
r := bufio.NewReader(bytes.NewReader(proof))
2625

2726
bstore := blockstore.NewBlockstore(dssync.MutexWrap(datastore.NewMapDatastore()))
@@ -66,7 +65,6 @@ func CreateProof(ctx context.Context, root cid.Cid, offset uint64, dserv ipld.DA
6665

6766
var currOffset, layer uint64
6867
for n != nil {
69-
fmt.Printf("In layer %d, numLinks=%d\n", layer, len(n.Links()))
7068
var next ipld.Node
7169
for _, child := range n.Links() {
7270
cn, err := child.GetNode(ctx, dserv)
@@ -75,14 +73,14 @@ func CreateProof(ctx context.Context, root cid.Cid, offset uint64, dserv ipld.DA
7573
}
7674
list = append(list, cn)
7775

78-
fmt.Printf("\t%s currOffset=%d\n", child.Cid, currOffset)
7976
if next == nil {
8077
fsNode, err := unixfs.ExtractFSNode(n)
8178
if err != nil {
8279
return nil, fmt.Errorf("extracting fsnode from merkle-dag: %s", err)
8380
}
8481
if currOffset+fsNode.FileSize() >= offset {
8582
next = cn
83+
break
8684
} else {
8785
currOffset += fsNode.FileSize()
8886
}

0 commit comments

Comments
 (0)