@cryptotaxi247 / kubo / commits / 65c66fd09

fix dht command key escaping

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Feb 14, 2016 at 23:58 UTC 65c66fd09b75d13f3b663db0fd2420e152ea6869
2 files changed +4 -1
core/commands/dht.go
+3 -1
@@ -354,6 +354,8 @@ GetValue will return the value stored in the DHT at the given key.
354 return
355 }
356
357 + log.Error("RESOLVE KEY: ", []byte(dhtkey))
358 +
359 go func() {
360 defer close(outChan)
361 for e := range events {
@@ -573,7 +575,7 @@ func escapeDhtKey(s string) (key.Key, error) {
575 return key.B58KeyDecode(s), nil
576 case 3:
577 k := key.B58KeyDecode(parts[2])
576 - return key.Key(path.Join(append(parts[:2], k.String()))), nil
578 + return key.Key(path.Join(append(parts[:2], string(k)))), nil
579 default:
580 return "", errors.New("invalid key")
581 }
namesys/publisher.go
+1
@@ -141,6 +141,7 @@ func PutRecordToRouting(ctx context.Context, k ci.PrivKey, value path.Path, seqn
141 return err
142 }
143
144 + log.Error("KEY: ", []byte(namekey))
145 ttl, ok := checkCtxTTL(ctx)
146 if ok {
147 entry.Ttl = proto.Uint64(uint64(ttl.Nanoseconds()))