print out correct object for dht findproviders command
Jeromy committed
Jan 25, 2015 at 01:21 UTC
403940af42a658fc27ac4e28097f5b8d3fd6f02d
1 file changed
+10
-1
core/commands/dht.go
+10
-1
@@ -209,7 +209,16 @@ FindProviders will return a list of peers who are able to provide the value requ
209
fmt.Fprintf(buf, "* closest peer %s\n", obj.ID)
210
}
211
case notif.Provider:
212
- fmt.Fprintf(buf, "%s\n", obj.ID.Pretty())
212
+ prov := obj.Responses[0]
213
+ if verbose {
214
+ fmt.Fprintf(buf, "provider: ")
215
+ }
216
+ fmt.Fprintf(buf, "%s\n", prov.ID.Pretty())
217
+ if verbose {
218
+ for _, a := range prov.Addrs {
219
+ fmt.Fprintf(buf, "\t%s\n", a)
220
+ }
221
+ }
222
case notif.PeerResponse:
223
if verbose {
224
fmt.Fprintf(buf, "* %s says use ", obj.ID)