From 8ddfb57c59ba452e87f278c55ec2cbcdd0467c2c Mon Sep 17 00:00:00 2001 From: Jeromy <jeromyj@gmail.com> Date: Thu, 11 Sep 2014 19:12:14 +0000 Subject: [PATCH] some bugfixes and added logging --- core/commands/add.go | 1 + core/core.go | 2 ++ routing/dht/routing.go | 9 ++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index c98ee145..f6c5492a 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -94,6 +94,7 @@ func addDir(n *core.IpfsNode, fpath string, depth int) (*dag.Node, error) { } } + fmt.Printf("Adding dir: %s = %s\n", fpath) return tree, addNode(n, tree, fpath) } diff --git a/core/core.go b/core/core.go index 005b6e62..f29f87ab 100644 --- a/core/core.go +++ b/core/core.go @@ -238,3 +238,5 @@ func (n *IpfsNode) PinDagNode(nd *merkledag.Node) error { u.DOut("Pinning node. Currently No-Op\n") return nil } + +func (n *IpfsNode) SetIpnsEntry() {} diff --git a/routing/dht/routing.go b/routing/dht/routing.go index 16f74380..3d7a4bf0 100644 --- a/routing/dht/routing.go +++ b/routing/dht/routing.go @@ -152,15 +152,14 @@ func (dht *IpfsDHT) FindProvidersAsync2(ctx context.Context, key u.Key, count in peers := dht.routingTables[0].NearestPeers(kb.ConvertKey(key), AlphaValue) for _, pp := range peers { - ppp := pp - go func() { - pmes, err := dht.findProvidersSingle(ctx, ppp, key, 0) + go func(p *peer.Peer) { + pmes, err := dht.findProvidersSingle(p, key, 0, timeout) if err != nil { u.PErr("%v\n", err) return } - dht.addPeerListAsync(key, pmes.GetProviderPeers(), ps, count, peerOut) - }() + dht.addPeerListAsync(key, pmes.GetPeers(), ps, count, peerOut) + }(pp) } }() -- GitLab