Skip to content
Permalink
Browse files

Bug fix: input isn't valid multihash

Some command were failing with `input isn't valid multihash`, due to
empty peer.ID. This commit omit peer id from IPFSID when empty, thus
avoiding the error state
  • Loading branch information...
kishansagathiya committed Mar 14, 2019
1 parent 5081310 commit 8a06936ccd02fa718bf5eac56da981a676475855
Showing with 2 additions and 2 deletions.
  1. +1 −1 api/types.go
  2. +1 −1 cmd/ipfs-cluster-ctl/formatters.go
@@ -351,7 +351,7 @@ type ID struct {

// IPFSID is used to store information about the underlying IPFS daemon
type IPFSID struct {
ID peer.ID `json:"id" codec:"i,omitempty"`
ID peer.ID `json:"id,omitempty" codec:"i,omitempty"`
Addresses []Multiaddr `json:"addresses" codec:"a,omitempty"`
Error string `json:"error" codec:"e,omitempty"`
}
@@ -93,7 +93,7 @@ func textFormatObject(resp interface{}) {

func textFormatPrintID(obj *api.ID) {
if obj.Error != "" {
fmt.Printf("%s | ERROR: %s\n", obj.ID, obj.Error)
fmt.Printf("%s | ERROR: %s\n", obj.ID.Pretty(), obj.Error)
return
}

0 comments on commit 8a06936

Please sign in to comment.
You can’t perform that action at this time.