提交 ee449cb8 作者: Alex

Fixed #780

上级 8ec51821
...@@ -39,10 +39,11 @@ func (id ID) Loggable() map[string]interface{} { ...@@ -39,10 +39,11 @@ func (id ID) Loggable() map[string]interface{} {
func (id ID) String() string { func (id ID) String() string {
pid := id.Pretty() pid := id.Pretty()
maxRunes := 6 maxRunes := 6
if len(pid) < maxRunes { skip := 2 //Added to skip past Qm which is identical for all SHA256 nodes
maxRunes = len(pid) if len(pid) < maxRunes + skip {
maxRunes = len(pid) - skip
} }
return fmt.Sprintf("<peer.ID %s>", pid[:maxRunes]) return fmt.Sprintf("<peer.ID %s>", pid[skip:maxRunes + skip])
} }
// MatchesPrivateKey tests whether this ID was derived from sk // MatchesPrivateKey tests whether this ID was derived from sk
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论