turn logging on by default, also make Provide not fail when no peers connected

This commit is contained in:
Jeromy 2014-09-22 19:22:04 -07:00
parent adcf0bfe70
commit 7bc4fbfa5d
3 changed files with 2 additions and 3 deletions

View File

@ -62,7 +62,7 @@ func ipfsCmd(c *commander.Command, args []string) error {
}
func main() {
// u.Debug = true
u.Debug = true
err := CmdIpfs.Dispatch(os.Args[1:])
if err != nil {
if len(err.Error()) > 0 {

View File

@ -30,7 +30,6 @@ var cmdIpfsMount = &commander.Command{
}
func mountCmd(c *commander.Command, inp []string) error {
u.Debug = false
if len(inp) < 1 || len(inp[0]) == 0 {
u.POut(c.Long)
return nil

View File

@ -194,7 +194,7 @@ func (dht *IpfsDHT) FindProviders(ctx context.Context, key u.Key) ([]*peer.Peer,
u.DOut("Find providers for: '%s'\n", key)
p := dht.routingTables[0].NearestPeer(kb.ConvertKey(key))
if p == nil {
return nil, kb.ErrLookupFailure
return nil, nil
}
for level := 0; level < len(dht.routingTables); {