diff options
Diffstat (limited to 'server/dht.go')
-rw-r--r-- | server/dht.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/dht.go b/server/dht.go index 40bf4e6..19ffe17 100644 --- a/server/dht.go +++ b/server/dht.go @@ -2,7 +2,6 @@ package main import ( "bytes" - "crypto/ed25519" "crypto/sha256" "encoding/base64" "encoding/binary" @@ -114,12 +113,11 @@ func peerHandler(w http.ResponseWriter, r *http.Request) { } // Get the timestamp of this val -func timestamp(val []byte) int64 { - if len(val) < 8+ed25519.SignatureSize { +func timestamp(val []byte) uint64 { + if len(val) < 8 { return 0 } - ret, _ := binary.Varint(val[:8]) - return ret + return binary.LittleEndian.Uint64(val) } // Get the value for a key from the DHT |