aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go
index 2c90f65c8..18b6831e0 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/node.go
@@ -19,6 +19,7 @@ package types
import (
"bytes"
+ "encoding/hex"
"github.com/dexon-foundation/dexon-consensus/common"
"github.com/dexon-foundation/dexon-consensus/core/crypto"
@@ -40,6 +41,10 @@ func (v NodeID) Equal(v2 NodeID) bool {
return v.Hash == v2.Hash
}
+func (v NodeID) String() string {
+ return hex.EncodeToString(v.Hash[:])[:6]
+}
+
// NodeIDs implements sort.Interface for NodeID.
type NodeIDs []NodeID