Skip to content

Commit

Permalink
Merge pull request #61 from vpavlin/fix/peer-id-hashing
Browse files Browse the repository at this point in the history
fix: use plain peerId for protocolStats
  • Loading branch information
adklempner authored Oct 1, 2024
2 parents 53fa8ac + 5f310df commit 5ee01e0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions telemetry/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package telemetry

import (
"context"
"crypto/sha256"
"database/sql"
"encoding/hex"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -187,9 +185,6 @@ func (s *Server) createProtocolStats(w http.ResponseWriter, r *http.Request) {
}
defer r.Body.Close()

peerIDHash := sha256.Sum256([]byte(protocolStats.PeerID))
protocolStats.PeerID = hex.EncodeToString(peerIDHash[:])

if err := protocolStats.Put(s.DB); err != nil {
s.logger.Error("failed to save protocol stats", zap.Error(err))
err := common.RespondWithError(w, http.StatusInternalServerError, "Could not save protocol stats")
Expand Down

0 comments on commit 5ee01e0

Please sign in to comment.