pool: Use PublicKey like cache key instead of PrivateKey

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
This commit is contained in:
Evgenii Baidakov 2023-04-25 14:08:47 +04:00
parent dbbb22ca28
commit 77c2e227b9
No known key found for this signature in database
GPG key ID: 8733EE3D72CDB4DE

View file

@ -1850,8 +1850,10 @@ func (p *innerPool) connection() (client, error) {
}
func formCacheKey(address string, key *ecdsa.PrivateKey) string {
k := keys.PrivateKey{PrivateKey: *key}
return address + k.String()
buf := make([]byte, 33)
copy(buf, (*keys.PublicKey)(&key.PublicKey).Bytes())
return address + string(buf)
}
func (p *Pool) checkSessionTokenErr(err error, address string) bool {