From 9bd059c3964caf40e217990a934a2b5db71ecf22 Mon Sep 17 00:00:00 2001
From: Hans Moog <hm@mkjc.net>
Date: Thu, 11 Apr 2019 11:50:37 +0200
Subject: [PATCH] Fix: fixed wrong import

---
 packages/crypto/hash20.go                | 16 ++++++++++++++++
 packages/identity/identity.go            |  2 +-
 plugins/autopeering/saltmanager/utils.go |  3 +--
 3 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 packages/crypto/hash20.go

diff --git a/packages/crypto/hash20.go b/packages/crypto/hash20.go
new file mode 100644
index 00000000..9804b9fd
--- /dev/null
+++ b/packages/crypto/hash20.go
@@ -0,0 +1,16 @@
+package crypto
+
+import (
+    "crypto/sha256"
+    "golang.org/x/crypto/ripemd160"
+)
+
+func Hash20(input []byte) []byte {
+    sha256Hasher := sha256.New()
+    sha256Hasher.Write(input)
+
+    ripemd160Hasher := ripemd160.New()
+    ripemd160Hasher.Write(sha256Hasher.Sum(nil))
+
+    return ripemd160Hasher.Sum(nil)
+}
diff --git a/packages/identity/identity.go b/packages/identity/identity.go
index 05815470..0aa55efd 100644
--- a/packages/identity/identity.go
+++ b/packages/identity/identity.go
@@ -7,7 +7,7 @@ import (
     "crypto/sha256"
     "fmt"
     "github.com/ethereum/go-ethereum/crypto/secp256k1"
-    "github.com/iotadevelopment/consensus/crypto"
+    "github.com/iotaledger/goshimmer/packages/crypto"
 )
 
 type Identity struct {
diff --git a/plugins/autopeering/saltmanager/utils.go b/plugins/autopeering/saltmanager/utils.go
index bc7c2046..5142c84b 100644
--- a/plugins/autopeering/saltmanager/utils.go
+++ b/plugins/autopeering/saltmanager/utils.go
@@ -1,7 +1,6 @@
 package saltmanager
 
 import (
-    "github.com/iotadevelopment/shimmer/plugins/autopeering/saltmanager"
     "github.com/iotaledger/goshimmer/plugins/autopeering/protocol/salt"
     "time"
 )
@@ -11,7 +10,7 @@ func CheckSalt(saltToCheck *salt.Salt) error {
     if saltToCheck.ExpirationTime.Before(now.Add(-1 * time.Minute)) {
         return ErrPublicSaltExpired
     }
-    if saltToCheck.ExpirationTime.After(now.Add(saltmanager.PUBLIC_SALT_LIFETIME + 1 * time.Minute)) {
+    if saltToCheck.ExpirationTime.After(now.Add(PUBLIC_SALT_LIFETIME + 1 * time.Minute)) {
         return ErrPublicSaltInvalidLifetime
     }
 
-- 
GitLab