Restore using just hex in peer extension expvar

This commit is contained in:
Matt Joiner 2023-05-03 20:15:06 +10:00
parent 20b437730d
commit c8fd8884b1
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
1 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"crypto/rand"
"crypto/sha1"
"encoding/binary"
"encoding/hex"
"errors"
"expvar"
"fmt"
@ -1038,7 +1039,8 @@ func (cl *Client) connBtHandshake(c *PeerConn, ih *metainfo.Hash) (ret metainfo.
if err != nil {
return
}
successfulPeerWireProtocolHandshakePeerReservedBytes.Add(res.PeerExtensionBits.String(), 1)
successfulPeerWireProtocolHandshakePeerReservedBytes.Add(
hex.EncodeToString(res.PeerExtensionBits[:]), 1)
ret = res.Hash
c.PeerExtensionBytes = res.PeerExtensionBits
c.PeerID = res.PeerID