Commit 2d16d252 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #848 from techfreek/master

peer short tags are improved
parents 014f0108 da80f22b
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"fmt" "fmt"
"strings"
b58 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58" b58 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
...@@ -38,6 +39,13 @@ func (id ID) Loggable() map[string]interface{} { ...@@ -38,6 +39,13 @@ func (id ID) Loggable() map[string]interface{} {
// codebase is known to be correct. // codebase is known to be correct.
func (id ID) String() string { func (id ID) String() string {
pid := id.Pretty() pid := id.Pretty()
//All sha256 nodes start with Qm
//We can skip the Qm to make the peer.ID more useful
if strings.HasPrefix(pid, "Qm") {
pid = pid[2:]
}
maxRunes := 6 maxRunes := 6
if len(pid) < maxRunes { if len(pid) < maxRunes {
maxRunes = len(pid) maxRunes = len(pid)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment