From 7ba6b7fa09026574f3cd2ff710eadbbf62055282 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 10 Oct 2017 19:38:50 -0700 Subject: [PATCH] routing: add a String() method to the vertex type --- routing/pathfind.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routing/pathfind.go b/routing/pathfind.go index 080d46c92..03d8a4f11 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -273,6 +273,12 @@ func newVertex(pub *btcec.PublicKey) vertex { return v } +// String returns a human readable version of the vertex which is the +// hex-encoding of the serialized compressed public key. +func (v vertex) String() string { + return fmt.Sprintf("%x", v[:]) +} + // edgeWithPrev is a helper struct used in path finding that couples an // directional edge with the node's ID in the opposite direction. type edgeWithPrev struct {