gossip: update pong hash calc

This commit is contained in:
Richard Patel 2023-06-29 00:13:16 +00:00
parent b1e895b40b
commit f4de38e3fe
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ func (p *Ping) Verify() bool {
// HashPingToken returns the pong token given a ping token.
func HashPingToken(token [32]byte) [32]byte {
return sha256.Sum256(token[:])
h := sha256.New()
h.Write([]byte("SOLANA_PING_PONG"))
h.Write(token[:])
return *(*[32]byte)(h.Sum(nil))
}
// PingClient implements the stateful client (initiator) side of the gossip ping protocol.